pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/46089: libmp4v2 fpos_t on NetBSD 6.99.3
The following reply was made to PR pkg/46089; it has been noted by GNATS.
From: Thomas Klausner <wiz%NetBSD.org@localhost>
To: NetBSD bugtracking <gnats-bugs%NetBSD.org@localhost>
Cc:
Subject: Re: pkg/46089: libmp4v2 fpos_t on NetBSD 6.99.3
Date: Fri, 24 Feb 2012 18:26:31 +0100
--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Fri, Feb 24, 2012 at 05:10:00PM +0000, davshao%gmail.com@localhost wrote:
> >Synopsis: libmp4v2 fpos_t on NetBSD 6.99.3
The attached patches make it compile for me, but I'm not sure if they are
correct.
Thomas
--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="fpos.diff"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/multimedia/libmp4v2/distinfo,v
retrieving revision 1.9
diff -u -r1.9 distinfo
--- distinfo 22 Feb 2012 15:39:43 -0000 1.9
+++ distinfo 24 Feb 2012 17:25:56 -0000
@@ -15,3 +15,5 @@
SHA1 (patch-aj) = f0aeab4c17bb8a737a9ae3d4385c9f2989540ea7
SHA1 (patch-ak) = 36da5d4d2824cc8b3ac62e10924058dd651cb2a7
SHA1 (patch-al) = 9ddfdeb35655c739c230d66f20e205b899af0b48
+SHA1 (patch-lib_mp4v2_mp4file__io.cpp) =
52977b7d2fc8a8c3cb5920000cd70048b570eabc
+SHA1 (patch-lib_mp4v2_virtual__io.cpp) =
7542f36520358ee2d2db63f77f5382c1571deba6
Index: patches/patch-lib_mp4v2_mp4file__io.cpp
===================================================================
RCS file: patches/patch-lib_mp4v2_mp4file__io.cpp
diff -N patches/patch-lib_mp4v2_mp4file__io.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_mp4v2_mp4file__io.cpp 24 Feb 2012 17:25:56 -0000
@@ -0,0 +1,34 @@
+$NetBSD$
+
+Avoid fpos file type and casting.
+
+--- lib/mp4v2/mp4file_io.cpp.orig 2007-04-30 20:29:28.000000000 +0000
++++ lib/mp4v2/mp4file_io.cpp
+@@ -34,13 +34,11 @@ u_int64_t MP4File::GetPosition(FILE* pFi
+ }
+ return fpos;
+ } else {
+- fpos_t fpos;
+- if (fgetpos(pFile, &fpos) < 0) {
++ off_t pos;
++ if (ftello(pFile) < 0) {
+ throw new MP4Error(errno, "MP4GetPosition");
+ }
+- uint64_t ret;
+- FPOS_TO_VAR(fpos, uint64_t, ret);
+- return ret;
++ return pos;
+ }
+ } else {
+ return m_memoryBufferPosition;
+@@ -56,9 +54,7 @@ void MP4File::SetPosition(u_int64_t pos,
+ throw new MP4Error("setting position via
Virtual I/O", "MP4SetPosition");
+ }
+ } else {
+- fpos_t fpos;
+- VAR_TO_FPOS(fpos, pos);
+- if (fsetpos(pFile, &fpos) < 0) {
++ if (fseeko(pFile, pos, SEEK_SET) < 0) {
+ throw new MP4Error(errno, "MP4SetPosition");
+ }
+ }
Index: patches/patch-lib_mp4v2_virtual__io.cpp
===================================================================
RCS file: patches/patch-lib_mp4v2_virtual__io.cpp
diff -N patches/patch-lib_mp4v2_virtual__io.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_mp4v2_virtual__io.cpp 24 Feb 2012 17:25:56 -0000
@@ -0,0 +1,31 @@
+$NetBSD$
+
+Avoid fpos file type and casting.
+
+--- lib/mp4v2/virtual_io.cpp.orig 2006-10-23 22:26:38.000000000 +0000
++++ lib/mp4v2/virtual_io.cpp
+@@ -39,20 +39,18 @@ u_int64_t FILE_GetFileLength(void *user)
+ int FILE_SetPosition(void *user, u_int64_t position)
+ {
+ FILE *fp = (FILE *)user;
+- fpos_t fpos;
+- VAR_TO_FPOS(fpos, position);
+- return fsetpos(fp, &fpos);
++ return fseeko(fp, position, SEEK_SET);
+ }
+
+ int FILE_GetPosition(void *user, u_int64_t *position)
+ {
+ FILE *fp = (FILE *)user;
+- fpos_t fpos;
+- if (fgetpos(fp, &fpos) < 0) {
++ off_t pos;
++ if ((pos=ftello(fp)) < 0) {
+ throw new MP4Error(errno, "MP4GetPosition");
+ }
+
+- FPOS_TO_VAR(fpos, u_int64_t, *position);
++ *position = pos;
+ return 0;
+ }
+
--EeQfGwPcQSOJBaQU--
Home |
Main Index |
Thread Index |
Old Index