diff options
author | christos <christos@pkgsrc.org> | 2012-02-24 18:36:48 +0000 |
---|---|---|
committer | christos <christos@pkgsrc.org> | 2012-02-24 18:36:48 +0000 |
commit | d0724539eee0f0c88ec8935dbf7b9a12c84d13e8 (patch) | |
tree | f490c699a9f80842b5221b2995e7a6ff3430c222 /multimedia | |
parent | 4758f3eaddd62b58398067aeef29381c57de4841 (diff) | |
download | pkgsrc-d0724539eee0f0c88ec8935dbf7b9a12c84d13e8.tar.gz |
PR/46089: David Shao: Don't use f{g,s}etpos because there is no portable
way of extracting the offset from them, which is all that is needed in
this case. Just use fseeko/ftello.
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/libmp4v2/patches/patch-am | 32 | ||||
-rw-r--r-- | multimedia/libmp4v2/patches/patch-ao | 28 | ||||
-rw-r--r-- | multimedia/libmp4v2/patches/patch-ap | 27 | ||||
-rw-r--r-- | multimedia/libmp4v2/patches/patch-aq | 26 | ||||
-rw-r--r-- | multimedia/libmp4v2/patches/patch-ar | 31 | ||||
-rw-r--r-- | multimedia/libmp4v2/patches/patch-as | 15 | ||||
-rw-r--r-- | multimedia/libmp4v2/patches/patch-at | 15 | ||||
-rw-r--r-- | multimedia/libmp4v2/patches/patch-au | 15 | ||||
-rw-r--r-- | multimedia/libmp4v2/patches/patch-av | 15 |
9 files changed, 204 insertions, 0 deletions
diff --git a/multimedia/libmp4v2/patches/patch-am b/multimedia/libmp4v2/patches/patch-am new file mode 100644 index 00000000000..488a4d468d8 --- /dev/null +++ b/multimedia/libmp4v2/patches/patch-am @@ -0,0 +1,32 @@ +$NetBSD: patch-am,v 1.1 2012/02/24 18:36:48 christos Exp $ + +--- lib/mp4v2/mp4file_io.cpp.orig 2007-04-30 16:29:28.000000000 -0400 ++++ lib/mp4v2/mp4file_io.cpp 2012-02-24 13:04:54.000000000 -0500 +@@ -34,13 +34,11 @@ + } + return fpos; + } else { +- fpos_t fpos; +- if (fgetpos(pFile, &fpos) < 0) { ++ u_int64_t fpos = ftello(pFile); ++ if (fpos == (u_int64_t)-1) { + throw new MP4Error(errno, "MP4GetPosition"); + } +- uint64_t ret; +- FPOS_TO_VAR(fpos, uint64_t, ret); +- return ret; ++ return fpos; + } + } else { + return m_memoryBufferPosition; +@@ -56,9 +54,7 @@ + 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"); + } + } diff --git a/multimedia/libmp4v2/patches/patch-ao b/multimedia/libmp4v2/patches/patch-ao new file mode 100644 index 00000000000..e19d25a02c3 --- /dev/null +++ b/multimedia/libmp4v2/patches/patch-ao @@ -0,0 +1,28 @@ +$NetBSD: patch-ao,v 1.1 2012/02/24 18:36:48 christos Exp $ + +--- lib/mp4v2/virtual_io.cpp.orig 2006-10-23 18:26:38.000000000 -0400 ++++ lib/mp4v2/virtual_io.cpp 2012-02-24 13:04:41.000000000 -0500 +@@ -39,20 +39,16 @@ + 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) == -1 ? -1 : 0; + } + + int FILE_GetPosition(void *user, u_int64_t *position) + { + FILE *fp = (FILE *)user; +- fpos_t fpos; +- if (fgetpos(fp, &fpos) < 0) { ++ *position = ftello(fp); ++ if (*position == (u_int64_t)-1) { + throw new MP4Error(errno, "MP4GetPosition"); + } +- +- FPOS_TO_VAR(fpos, u_int64_t, *position); + return 0; + } + diff --git a/multimedia/libmp4v2/patches/patch-ap b/multimedia/libmp4v2/patches/patch-ap new file mode 100644 index 00000000000..ec0db3aeeb2 --- /dev/null +++ b/multimedia/libmp4v2/patches/patch-ap @@ -0,0 +1,27 @@ +$NetBSD: patch-ap,v 1.1 2012/02/24 18:36:48 christos Exp $ + +--- lib/mpeg2t/mpeg2t_dump.cpp.orig 2007-02-07 12:34:16.000000000 -0500 ++++ lib/mpeg2t/mpeg2t_dump.cpp 2012-02-24 13:05:14.000000000 -0500 +@@ -18,7 +18,7 @@ + mpeg2t_es_t *es_pid; + mpeg2t_pid_t *pidptr; + bool verbose = false; +- fpos_t pos; ++ u_int64_t pos; + const char *ProgName = argv[0]; + const char *usage = ""; + uint16_t pid = 0; +@@ -97,11 +97,9 @@ + if (buflen > 0) { + memmove(buffer, buffer + readfromfile - buflen, buflen); + } +- fgetpos(ifile, &pos); ++ pos = ftello(ifile); + if (verbose) { +- uint64_t position; +- FPOS_TO_VAR(pos, uint64_t, position); +- fprintf(stdout, "file pos %llu\n", position); ++ fprintf(stdout, "file pos %llu\n", pos); + } + readfromfile = buflen + fread(buffer + buflen, 1, BUFFER_SIZE - buflen, ifile); + buflen = readfromfile; diff --git a/multimedia/libmp4v2/patches/patch-aq b/multimedia/libmp4v2/patches/patch-aq new file mode 100644 index 00000000000..6015ab29dd9 --- /dev/null +++ b/multimedia/libmp4v2/patches/patch-aq @@ -0,0 +1,26 @@ +$NetBSD: patch-aq,v 1.1 2012/02/24 18:36:48 christos Exp $ + +--- lib/mpeg2t/mpeg2t_extract.cpp.orig 2007-03-29 14:52:16.000000000 -0400 ++++ lib/mpeg2t/mpeg2t_extract.cpp 2012-02-24 13:05:47.000000000 -0500 +@@ -34,7 +34,7 @@ + mpeg2t_es_t *es_pid; + mpeg2t_pid_t *pidptr; + bool verbose = false; +- fpos_t pos; ++ u_int64_t pos; + const char *ProgName = argv[0]; + const char *usage = ""; + uint16_t pid = 0; +@@ -119,10 +119,8 @@ + if (buflen > 0) { + memmove(buffer, buffer + readfromfile - buflen, buflen); + } +- fgetpos(ifile, &pos); +- uint64_t position; +- FPOS_TO_VAR(pos, uint64_t, position); +- fprintf(stdout, "file pos %llu\n", position); ++ pos = ftello(ifile); ++ fprintf(stdout, "file pos %llu\n", pos); + readfromfile = buflen + fread(buffer + buflen, 1, BUFFER_SIZE - buflen, ifile); + buflen = readfromfile; + ptr = buffer; diff --git a/multimedia/libmp4v2/patches/patch-ar b/multimedia/libmp4v2/patches/patch-ar new file mode 100644 index 00000000000..ba0e7c30557 --- /dev/null +++ b/multimedia/libmp4v2/patches/patch-ar @@ -0,0 +1,31 @@ +$NetBSD: patch-ar,v 1.1 2012/02/24 18:36:48 christos Exp $ + +--- lib/mpeg2t/test.cpp.orig 2005-04-19 17:50:48.000000000 -0400 ++++ lib/mpeg2t/test.cpp 2012-02-24 13:06:28.000000000 -0500 +@@ -100,7 +100,7 @@ + mpeg2t_pid_t *pidptr; + int64_t start_offset = 0; + bool verbose = false; +- fpos_t pos; ++ u_int64_t pos; + const char *ProgName = argv[0]; + const char *usage = ""; + // int lastcc, ccset; +@@ -184,13 +184,11 @@ + printf("buflen is %d\n", buflen); + memmove(buffer, buffer + readfromfile - buflen, buflen); + } +- fgetpos(ifile, &pos); +- uint64_t position; +- FPOS_TO_VAR(pos, uint64_t, position); +- fprintf(stdout, "file pos 0x%llx %s\n", position - buflen, +- (position - buflen) % 188 == 0 ? "" : "no mult"); ++ pos = ftello(ifile); ++ fprintf(stdout, "file pos 0x%llx %s\n", pos - buflen, ++ (pos - buflen) % 188 == 0 ? "" : "no mult"); + +- if (position - buflen == 0x11a0) { ++ if (pos - buflen == 0x11a0) { + printf("here\n"); + } + readfromfile = buflen + fread(buffer + buflen, 1, BUFFER_SIZE - buflen, ifile); diff --git a/multimedia/libmp4v2/patches/patch-as b/multimedia/libmp4v2/patches/patch-as new file mode 100644 index 00000000000..1cfbd098f99 --- /dev/null +++ b/multimedia/libmp4v2/patches/patch-as @@ -0,0 +1,15 @@ +$NetBSD: patch-as,v 1.1 2012/02/24 18:36:48 christos Exp $ + +--- player/plugin/audio/mad/mp3_file.cpp.orig 2004-12-22 14:47:50.000000000 -0500 ++++ player/plugin/audio/mad/mp3_file.cpp 2012-02-24 13:07:19.000000000 -0500 +@@ -384,9 +384,7 @@ + mp3->m_framecount = fpos->frames; + mp3->m_buffer_on = 0; + mp3->m_buffer_size = 0; +- fpos_t pos; +- VAR_TO_FPOS(pos, fpos->file_position); +- fsetpos(mp3->m_ifile, &pos); ++ fseeko(mp3->m_ifile, &fpos->file_position, SEEK_SET); + return 0; + } + diff --git a/multimedia/libmp4v2/patches/patch-at b/multimedia/libmp4v2/patches/patch-at new file mode 100644 index 00000000000..6fa0372b2b2 --- /dev/null +++ b/multimedia/libmp4v2/patches/patch-at @@ -0,0 +1,15 @@ +$NetBSD: patch-at,v 1.1 2012/02/24 18:36:49 christos Exp $ + +--- player/plugin/video/xvid/xvid_file.cpp.orig 2005-02-25 19:10:54.000000000 -0500 ++++ player/plugin/video/xvid/xvid_file.cpp 2012-02-24 13:07:41.000000000 -0500 +@@ -395,9 +395,7 @@ + xvid->m_buffer_on = 0; + xvid->m_buffer_size = 0; + +- fpos_t pos; +- VAR_TO_FPOS(pos, fpos->file_position); +- fsetpos(xvid->m_ifile, &pos); ++ fseeko(xvid->m_ifile, fpos->file_position, SEEK_SET); + + xvid_reset_buffer(xvid); + return 0; diff --git a/multimedia/libmp4v2/patches/patch-au b/multimedia/libmp4v2/patches/patch-au new file mode 100644 index 00000000000..5958b68ef8b --- /dev/null +++ b/multimedia/libmp4v2/patches/patch-au @@ -0,0 +1,15 @@ +$NetBSD: patch-au,v 1.1 2012/02/24 18:36:49 christos Exp $ + +--- player/src/codec/mp3/mp3_file.cpp.orig 2006-04-17 15:03:50.000000000 -0400 ++++ player/src/codec/mp3/mp3_file.cpp 2012-02-24 13:07:57.000000000 -0500 +@@ -424,9 +424,7 @@ + mp3->m_framecount = fpos->frames; + mp3->m_buffer_on = 0; + mp3->m_buffer_size = 0; +- fpos_t pos; +- VAR_TO_FPOS(pos, fpos->file_position); +- fsetpos(mp3->m_ifile, &pos); ++ fseeko(mp3->m_ifile, fpos->file_position, SEEK_SET); + return 0; + } + diff --git a/multimedia/libmp4v2/patches/patch-av b/multimedia/libmp4v2/patches/patch-av new file mode 100644 index 00000000000..57a590c0269 --- /dev/null +++ b/multimedia/libmp4v2/patches/patch-av @@ -0,0 +1,15 @@ +$NetBSD: patch-av,v 1.1 2012/02/24 18:36:49 christos Exp $ + +--- player/src/codec/mpeg4/mpeg4_file.cpp.orig 2005-05-09 17:30:19.000000000 -0400 ++++ player/src/codec/mpeg4/mpeg4_file.cpp 2012-02-24 13:08:16.000000000 -0500 +@@ -362,9 +362,7 @@ + divx->m_buffer_on = 0; + divx->m_buffer_size = 0; + +- fpos_t pos; +- VAR_TO_FPOS(pos, fpos->file_position); +- fsetpos(divx->m_ifile, &pos); ++ fseeko(divx->m_ifile, fpos->file_position, SEEK_SET); + divx_reset_buffer(divx); + return 0; + } |