diff options
author | wiz <wiz@pkgsrc.org> | 2007-01-13 21:58:24 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2007-01-13 21:58:24 +0000 |
commit | 434aa7f4554065eef9b7d0e745f343f6336578a6 (patch) | |
tree | 170ccd6485777c915d904fc58583762481a3e081 /multimedia/mkvtoolnix | |
parent | b3f529ae14fe0e492a492165c90985cb3d756a4e (diff) | |
download | pkgsrc-434aa7f4554065eef9b7d0e745f343f6336578a6.tar.gz |
Support flac-1.1.3 based on a patch from
ftp.altlinux.org /pub/people/thresh
Bump PKGREVISION because this package just compiled without flac support.
Diffstat (limited to 'multimedia/mkvtoolnix')
-rw-r--r-- | multimedia/mkvtoolnix/Makefile | 4 | ||||
-rw-r--r-- | multimedia/mkvtoolnix/distinfo | 9 | ||||
-rw-r--r-- | multimedia/mkvtoolnix/patches/patch-ab | 116 | ||||
-rw-r--r-- | multimedia/mkvtoolnix/patches/patch-ad | 24 | ||||
-rw-r--r-- | multimedia/mkvtoolnix/patches/patch-ae | 55 | ||||
-rw-r--r-- | multimedia/mkvtoolnix/patches/patch-af | 361 | ||||
-rw-r--r-- | multimedia/mkvtoolnix/patches/patch-ag | 54 | ||||
-rw-r--r-- | multimedia/mkvtoolnix/patches/patch-ah | 53 |
8 files changed, 667 insertions, 9 deletions
diff --git a/multimedia/mkvtoolnix/Makefile b/multimedia/mkvtoolnix/Makefile index c452be1f359..0628d34f56c 100644 --- a/multimedia/mkvtoolnix/Makefile +++ b/multimedia/mkvtoolnix/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.13 2007/01/07 12:25:55 wiz Exp $ +# $NetBSD: Makefile,v 1.14 2007/01/13 21:58:24 wiz Exp $ # .include "../../multimedia/mkvtoolnix/Makefile.dist" -PKGREVISION= 1 +PKGREVISION= 2 MAINTAINER= salo@NetBSD.org HOMEPAGE= http://www.bunkus.org/videotools/mkvtoolnix/ diff --git a/multimedia/mkvtoolnix/distinfo b/multimedia/mkvtoolnix/distinfo index 91b140c2e18..3f8578ceb87 100644 --- a/multimedia/mkvtoolnix/distinfo +++ b/multimedia/mkvtoolnix/distinfo @@ -1,8 +1,13 @@ -$NetBSD: distinfo,v 1.22 2006/10/31 20:52:36 rillig Exp $ +$NetBSD: distinfo,v 1.23 2007/01/13 21:58:24 wiz Exp $ SHA1 (mkvtoolnix-1.7.0.tar.bz2) = c705af2778faac3e5244015646e331e811500b26 RMD160 (mkvtoolnix-1.7.0.tar.bz2) = 0c90a44f0b6df466a4799ed8fa2f99791059c7fb Size (mkvtoolnix-1.7.0.tar.bz2) = 655481 bytes SHA1 (patch-aa) = 602bd5b9af024a02bcb6b59714d6aaa0031cbd85 -SHA1 (patch-ab) = 0a2ecaf091aa0735440a12c1534dc58eeb8ec549 +SHA1 (patch-ab) = df0bd9e6ed99be6d1f3f711b3d43ab605fc6b3d8 SHA1 (patch-ac) = 8206116fcc72d757ac1456baae00a8254b8e4866 +SHA1 (patch-ad) = 9b57e92c910f84fa7b5eb88456fce6b08a3b0cf0 +SHA1 (patch-ae) = 47b34e89b259121fe731e9d55c404394be1fa1d6 +SHA1 (patch-af) = 402e4520d9b566e3422c983b80e8a005ed83b728 +SHA1 (patch-ag) = b9959a3c541447703fce51292097f3b33b146327 +SHA1 (patch-ah) = 85f638aa8fdc171a096a37ff2d580bfbe738d753 diff --git a/multimedia/mkvtoolnix/patches/patch-ab b/multimedia/mkvtoolnix/patches/patch-ab index ed22642ccbf..66b77dd251e 100644 --- a/multimedia/mkvtoolnix/patches/patch-ab +++ b/multimedia/mkvtoolnix/patches/patch-ab @@ -1,8 +1,114 @@ -$NetBSD: patch-ab,v 1.6 2006/10/08 05:22:19 salo Exp $ +$NetBSD: patch-ab,v 1.7 2007/01/13 21:58:24 wiz Exp $ ---- configure.orig 2006-10-08 03:30:41.000000000 +0000 -+++ configure 2006-10-08 03:52:30.000000000 +0000 -@@ -8620,7 +8620,7 @@ +--- configure.orig 2006-04-28 19:53:45.000000000 +0000 ++++ configure +@@ -6484,9 +6484,9 @@ else + fi; + + if test "$with_flac" != "no"; then +- echo "$as_me:$LINENO: checking for FLAC__seekable_stream_decoder_new in -lFLAC" >&5 +-echo $ECHO_N "checking for FLAC__seekable_stream_decoder_new in -lFLAC... $ECHO_C" >&6 +-if test "${ac_cv_lib_FLAC_FLAC__seekable_stream_decoder_new+set}" = set; then ++ echo "$as_me:$LINENO: checking for FLAC__stream_decoder_new in -lFLAC" >&5 ++echo $ECHO_N "checking for FLAC__stream_decoder_new in -lFLAC... $ECHO_C" >&6 ++if test "${ac_cv_lib_FLAC_FLAC__stream_decoder_new+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -6504,11 +6504,11 @@ extern "C" + #endif + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +-char FLAC__seekable_stream_decoder_new (); ++char FLAC__stream_decoder_new (); + int + main () + { +-FLAC__seekable_stream_decoder_new (); ++FLAC__stream_decoder_new (); + ; + return 0; + } +@@ -6534,20 +6534,20 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then +- ac_cv_lib_FLAC_FLAC__seekable_stream_decoder_new=yes ++ ac_cv_lib_FLAC_FLAC__stream_decoder_new=yes + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + +-ac_cv_lib_FLAC_FLAC__seekable_stream_decoder_new=no ++ac_cv_lib_FLAC_FLAC__stream_decoder_new=no + fi + rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-echo "$as_me:$LINENO: result: $ac_cv_lib_FLAC_FLAC__seekable_stream_decoder_new" >&5 +-echo "${ECHO_T}$ac_cv_lib_FLAC_FLAC__seekable_stream_decoder_new" >&6 +-if test $ac_cv_lib_FLAC_FLAC__seekable_stream_decoder_new = yes; then ++echo "$as_me:$LINENO: result: $ac_cv_lib_FLAC_FLAC__stream_decoder_new" >&5 ++echo "${ECHO_T}$ac_cv_lib_FLAC_FLAC__stream_decoder_new" >&6 ++if test $ac_cv_lib_FLAC_FLAC__stream_decoder_new = yes; then + FLAC_LIBS="-lFLAC -lm" + flac_found=yes + else +@@ -6669,9 +6669,9 @@ fi + + fi + if test x"$flac_found" = xyes ; then +- echo "$as_me:$LINENO: checking for FLAC__seekable_stream_decoder_skip_single_frame in -lFLAC" >&5 +-echo $ECHO_N "checking for FLAC__seekable_stream_decoder_skip_single_frame in -lFLAC... $ECHO_C" >&6 +-if test "${ac_cv_lib_FLAC_FLAC__seekable_stream_decoder_skip_single_frame+set}" = set; then ++ echo "$as_me:$LINENO: checking for FLAC__stream_decoder_skip_single_frame in -lFLAC" >&5 ++echo $ECHO_N "checking for FLAC__stream_decoder_skip_single_frame in -lFLAC... $ECHO_C" >&6 ++if test "${ac_cv_lib_FLAC_FLAC__stream_decoder_skip_single_frame+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -6689,11 +6689,11 @@ extern "C" + #endif + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +-char FLAC__seekable_stream_decoder_skip_single_frame (); ++char FLAC__stream_decoder_skip_single_frame (); + int + main () + { +-FLAC__seekable_stream_decoder_skip_single_frame (); ++FLAC__stream_decoder_skip_single_frame (); + ; + return 0; + } +@@ -6719,20 +6719,20 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then +- ac_cv_lib_FLAC_FLAC__seekable_stream_decoder_skip_single_frame=yes ++ ac_cv_lib_FLAC_FLAC__stream_decoder_skip_single_frame=yes + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + +-ac_cv_lib_FLAC_FLAC__seekable_stream_decoder_skip_single_frame=no ++ac_cv_lib_FLAC_FLAC__stream_decoder_skip_single_frame=no + fi + rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-echo "$as_me:$LINENO: result: $ac_cv_lib_FLAC_FLAC__seekable_stream_decoder_skip_single_frame" >&5 +-echo "${ECHO_T}$ac_cv_lib_FLAC_FLAC__seekable_stream_decoder_skip_single_frame" >&6 +-if test $ac_cv_lib_FLAC_FLAC__seekable_stream_decoder_skip_single_frame = yes; then ++echo "$as_me:$LINENO: result: $ac_cv_lib_FLAC_FLAC__stream_decoder_skip_single_frame" >&5 ++echo "${ECHO_T}$ac_cv_lib_FLAC_FLAC__stream_decoder_skip_single_frame" >&6 ++if test $ac_cv_lib_FLAC_FLAC__stream_decoder_skip_single_frame = yes; then + flac_decoder_skip_found=yes + else + flac_decoder_skip_found=no +@@ -8620,7 +8620,7 @@ if test "${ac_cv_lib_magic_magic_open+se echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11,7 +117,7 @@ $NetBSD: patch-ab,v 1.6 2006/10/08 05:22:19 salo Exp $ cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF -@@ -8678,7 +8678,7 @@ +@@ -8678,7 +8678,7 @@ fi echo "$as_me:$LINENO: result: $ac_cv_lib_magic_magic_open" >&5 echo "${ECHO_T}$ac_cv_lib_magic_magic_open" >&6 if test $ac_cv_lib_magic_magic_open = yes; then diff --git a/multimedia/mkvtoolnix/patches/patch-ad b/multimedia/mkvtoolnix/patches/patch-ad new file mode 100644 index 00000000000..80789f90a35 --- /dev/null +++ b/multimedia/mkvtoolnix/patches/patch-ad @@ -0,0 +1,24 @@ +$NetBSD: patch-ad,v 1.1 2007/01/13 21:58:24 wiz Exp $ + +--- configure.in.orig 2006-04-28 14:52:55.000000000 +0000 ++++ configure.in +@@ -495,8 +495,8 @@ dnl + [ with_flac=${withval} ], [ with_flac=yes ]) + + if test "$with_flac" != "no"; then +- AC_CHECK_LIB(FLAC, FLAC__seekable_stream_decoder_new, +- [ FLAC_LIBS="-lFLAC -lm" ++ AC_CHECK_LIB(FLAC, FLAC__stream_decoder_new, ++ [ FLAC_LIBS="-lFLAC $OGG_LIBS -lm" + flac_found=yes ], + [ flac_found=no ], + "-lm") +@@ -510,7 +510,7 @@ dnl + ]) + fi + if test x"$flac_found" = xyes ; then +- AC_CHECK_LIB(FLAC, FLAC__seekable_stream_decoder_skip_single_frame, ++ AC_CHECK_LIB(FLAC, FLAC__stream_decoder_skip_single_frame, + [ flac_decoder_skip_found=yes ], + [ flac_decoder_skip_found=no ], + $FLAC_LIBS) diff --git a/multimedia/mkvtoolnix/patches/patch-ae b/multimedia/mkvtoolnix/patches/patch-ae new file mode 100644 index 00000000000..5a263191f3b --- /dev/null +++ b/multimedia/mkvtoolnix/patches/patch-ae @@ -0,0 +1,55 @@ +$NetBSD: patch-ae,v 1.1 2007/01/13 21:58:24 wiz Exp $ + +--- src/input/flac_common.cpp.orig 2005-09-03 12:32:53.000000000 +0000 ++++ src/input/flac_common.cpp +@@ -20,6 +20,11 @@ + #include <stdarg.h> + + #include <FLAC/stream_decoder.h> ++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 ++#define LEGACY_FLAC ++#else ++#undef LEGACY_FLAC ++#endif + + #include "bit_cursor.h" + #include "common.h" +@@ -145,7 +150,11 @@ typedef struct { + static FLAC__StreamDecoderReadStatus + flac_read_cb(const FLAC__StreamDecoder *, + FLAC__byte buffer[], ++#ifdef LEGACY_FLAC + unsigned *bytes, ++#else ++ size_t *bytes, ++#endif + void *client_data) { + flac_header_extractor_t *fhe; + int num_bytes; +@@ -210,6 +219,7 @@ flac_decode_headers(unsigned char *mem, + decoder = FLAC__stream_decoder_new(); + if (decoder == NULL) + mxerror(FPFX "FLAC__stream_decoder_new() failed.\n"); ++#ifdef LEGACY_FLAC + FLAC__stream_decoder_set_client_data(decoder, &fhe); + if (!FLAC__stream_decoder_set_read_callback(decoder, flac_read_cb)) + mxerror(FPFX "Could not set the read callback.\n"); +@@ -219,11 +229,18 @@ flac_decode_headers(unsigned char *mem, + mxerror(FPFX "Could not set the metadata callback.\n"); + if (!FLAC__stream_decoder_set_error_callback(decoder, flac_error_cb)) + mxerror(FPFX "Could not set the error callback.\n"); ++#endif + if (!FLAC__stream_decoder_set_metadata_respond_all(decoder)) + mxerror(FPFX "Could not set metadata_respond_all.\n"); ++#ifdef LEGACY_FLAC + if (FLAC__stream_decoder_init(decoder) != + FLAC__STREAM_DECODER_SEARCH_FOR_METADATA) + mxerror(FPFX "Could not initialize the FLAC decoder.\n"); ++#else ++ if (FLAC__stream_decoder_init_stream(decoder, flac_read_cb, NULL, NULL, NULL, NULL, flac_write_cb, flac_metadata_cb, flac_error_cb, &fhe) != ++ FLAC__STREAM_DECODER_INIT_STATUS_OK) ++ mxerror(FPFX "Could not initialize the FLAC decoder.\n"); ++#endif + FLAC__stream_decoder_process_until_end_of_stream(decoder); + + result = 0; diff --git a/multimedia/mkvtoolnix/patches/patch-af b/multimedia/mkvtoolnix/patches/patch-af new file mode 100644 index 00000000000..155fac0805c --- /dev/null +++ b/multimedia/mkvtoolnix/patches/patch-af @@ -0,0 +1,361 @@ +$NetBSD: patch-af,v 1.1 2007/01/13 21:58:24 wiz Exp $ + +--- src/input/r_flac.cpp.orig 2005-10-12 16:41:09.000000000 +0000 ++++ src/input/r_flac.cpp +@@ -20,9 +20,6 @@ + #include <string.h> + #include <ogg/ogg.h> + #include <vorbis/codec.h> +-#if defined(HAVE_FLAC_FORMAT_H) +-#include <FLAC/seekable_stream_decoder.h> +-#endif + + #include "common.h" + #include "flac_common.h" +@@ -36,6 +33,7 @@ + #if defined(HAVE_FLAC_FORMAT_H) + #define FPFX "flac_reader: " + ++#ifdef LEGACY_FLAC + static FLAC__SeekableStreamDecoderReadStatus + flac_read_cb(const FLAC__SeekableStreamDecoder *, + FLAC__byte buffer[], +@@ -43,55 +41,123 @@ flac_read_cb(const FLAC__SeekableStreamD + void *client_data) { + return ((flac_reader_c *)client_data)->read_cb(buffer, bytes); + } ++#else ++static FLAC__StreamDecoderReadStatus ++flac_read_cb(const FLAC__StreamDecoder *, ++ FLAC__byte buffer[], ++ size_t *bytes, ++ void *client_data) { ++ return ((flac_reader_c *)client_data)->read_cb(buffer, bytes); ++} ++#endif + + static FLAC__StreamDecoderWriteStatus ++#ifdef LEGACY_FLAC + flac_write_cb(const FLAC__SeekableStreamDecoder *, + const FLAC__Frame *frame, + const FLAC__int32 * const data[], + void *client_data) { + return ((flac_reader_c *)client_data)->write_cb(frame, data); + } ++#else ++flac_write_cb(const FLAC__StreamDecoder *, ++ const FLAC__Frame *frame, ++ const FLAC__int32 * const data[], ++ void *client_data) { ++ return ((flac_reader_c *)client_data)->write_cb(frame, data); ++} ++#endif + + static void ++#ifdef LEGACY_FLAC + flac_metadata_cb(const FLAC__SeekableStreamDecoder *, + const FLAC__StreamMetadata *metadata, + void *client_data) { + ((flac_reader_c *)client_data)->metadata_cb(metadata); + } ++#else ++flac_metadata_cb(const FLAC__StreamDecoder *, ++ const FLAC__StreamMetadata *metadata, ++ void *client_data) { ++ ((flac_reader_c *)client_data)->metadata_cb(metadata); ++} ++#endif + + static void ++#ifdef LEGACY_FLAC + flac_error_cb(const FLAC__SeekableStreamDecoder *, + FLAC__StreamDecoderErrorStatus status, + void *client_data) { + ((flac_reader_c *)client_data)->error_cb(status); + } ++#else ++flac_error_cb(const FLAC__StreamDecoder *, ++ FLAC__StreamDecoderErrorStatus status, ++ void *client_data) { ++ ((flac_reader_c *)client_data)->error_cb(status); ++} ++#endif + ++#ifdef LEGACY_FLAC + static FLAC__SeekableStreamDecoderSeekStatus + flac_seek_cb(const FLAC__SeekableStreamDecoder *, + FLAC__uint64 absolute_byte_offset, + void *client_data) { + return ((flac_reader_c *)client_data)->seek_cb(absolute_byte_offset); + } ++#else ++static FLAC__StreamDecoderSeekStatus ++flac_seek_cb(const FLAC__StreamDecoder *, ++ FLAC__uint64 absolute_byte_offset, ++ void *client_data) { ++ return ((flac_reader_c *)client_data)->seek_cb(absolute_byte_offset); ++} ++#endif + ++#ifdef LEGACY_FLAC + static FLAC__SeekableStreamDecoderTellStatus + flac_tell_cb(const FLAC__SeekableStreamDecoder *, + FLAC__uint64 *absolute_byte_offset, + void *client_data) { + return ((flac_reader_c *)client_data)->tell_cb(*absolute_byte_offset); + } ++#else ++static FLAC__StreamDecoderTellStatus ++flac_tell_cb(const FLAC__StreamDecoder *, ++ FLAC__uint64 *absolute_byte_offset, ++ void *client_data) { ++ return ((flac_reader_c *)client_data)->tell_cb(*absolute_byte_offset); ++} ++#endif + ++#ifdef LEGACY_FLAC + static FLAC__SeekableStreamDecoderLengthStatus + flac_length_cb(const FLAC__SeekableStreamDecoder *, + FLAC__uint64 *stream_length, + void *client_data) { + return ((flac_reader_c *)client_data)->length_cb(*stream_length); + } ++#else ++static FLAC__StreamDecoderLengthStatus ++flac_length_cb(const FLAC__StreamDecoder *, ++ FLAC__uint64 *stream_length, ++ void *client_data) { ++ return ((flac_reader_c *)client_data)->length_cb(*stream_length); ++} ++#endif + + static FLAC__bool ++#ifdef LEGACY_FLAC + flac_eof_cb(const FLAC__SeekableStreamDecoder *, + void *client_data) { + return ((flac_reader_c *)client_data)->eof_cb(); + } ++#else ++flac_eof_cb(const FLAC__StreamDecoder *, ++ void *client_data) { ++ return ((flac_reader_c *)client_data)->eof_cb(); ++} ++#endif + + int + flac_reader_c::probe_file(mm_io_c *io, +@@ -175,8 +241,13 @@ flac_reader_c::create_packetizer(int64_t + + bool + flac_reader_c::parse_file() { ++#ifdef LEGACY_FLAC + FLAC__SeekableStreamDecoder *decoder; + FLAC__SeekableStreamDecoderState state; ++#else ++ FLAC__StreamDecoder *decoder; ++ FLAC__StreamDecoderState state; ++#endif + flac_block_t block; + uint64_t u, old_pos; + int result, progress, old_progress; +@@ -186,9 +257,14 @@ flac_reader_c::parse_file() { + metadata_parsed = false; + + mxinfo("+-> Parsing the FLAC file. This can take a LONG time.\n"); ++#ifdef LEGACY_FLAC + decoder = FLAC__seekable_stream_decoder_new(); ++#else ++ decoder = FLAC__stream_decoder_new(); ++#endif + if (decoder == NULL) + mxerror(FPFX "FLAC__stream_decoder_new() failed.\n"); ++#ifdef LEGACY_FLAC + FLAC__seekable_stream_decoder_set_client_data(decoder, this); + if (!FLAC__seekable_stream_decoder_set_read_callback(decoder, flac_read_cb)) + mxerror(FPFX "Could not set the read callback.\n"); +@@ -218,9 +294,20 @@ flac_reader_c::parse_file() { + if (FLAC__seekable_stream_decoder_init(decoder) != + FLAC__SEEKABLE_STREAM_DECODER_OK) + mxerror(FPFX "Could not initialize the FLAC decoder.\n"); ++#else ++ if (!FLAC__stream_decoder_set_metadata_respond_all(decoder)) ++ mxerror(FPFX "Could not set metadata_respond_all.\n"); ++ if (FLAC__stream_decoder_init_stream(decoder, flac_read_cb, flac_seek_cb, flac_tell_cb, flac_length_cb, flac_eof_cb, flac_write_cb, flac_metadata_cb, flac_error_cb, this) != ++ FLAC__STREAM_DECODER_INIT_STATUS_OK) ++ mxerror(FPFX "Could not initialize the FLAC decoder.\n"); ++#endif + + result = ++#ifdef LEGACY_FLAC + (int)FLAC__seekable_stream_decoder_process_until_end_of_metadata(decoder); ++#else ++ (int)FLAC__stream_decoder_process_until_end_of_metadata(decoder); ++#endif + mxverb(2, FPFX "extract->metadata, result: %d, mdp: %d, num blocks: %u\n", + result, metadata_parsed, (unsigned int)blocks.size()); + +@@ -229,7 +316,11 @@ flac_reader_c::parse_file() { + ti.fname.c_str()); + + block.type = FLAC_BLOCK_TYPE_HEADERS; ++#ifdef LEGACY_FLAC + FLAC__seekable_stream_decoder_get_decode_position(decoder, &u); ++#else ++ FLAC__stream_decoder_get_decode_position(decoder, &u); ++#endif + block.filepos = 0; + block.len = u; + old_pos = u; +@@ -239,12 +330,20 @@ flac_reader_c::parse_file() { + + old_progress = -5; + #if defined(HAVE_FLAC_DECODER_SKIP) ++#ifdef LEGACY_FLAC + ok = FLAC__seekable_stream_decoder_skip_single_frame(decoder); + #else ++ ok = FLAC__stream_decoder_skip_single_frame(decoder); ++#endif ++#else + ok = FLAC__seekable_stream_decoder_process_single(decoder); + #endif + while (ok) { ++#ifdef LEGACY_FLAC + state = FLAC__seekable_stream_decoder_get_state(decoder); ++#else ++ state = FLAC__stream_decoder_get_state(decoder); ++#endif + + progress = (int)(file->getFilePointer() * 100 / file_size); + if ((progress - old_progress) >= 5) { +@@ -252,7 +351,12 @@ flac_reader_c::parse_file() { + old_progress = progress; + } + +- if (FLAC__seekable_stream_decoder_get_decode_position(decoder, &u) && ++ if ( ++#ifdef LEGACY_FLAC ++ FLAC__seekable_stream_decoder_get_decode_position(decoder, &u) && ++#else ++ FLAC__stream_decoder_get_decode_position(decoder, &u) && ++#endif + (u != old_pos)) { + block.type = FLAC_BLOCK_TYPE_DATA; + block.filepos = old_pos; +@@ -264,16 +368,25 @@ flac_reader_c::parse_file() { + block.filepos, block.len); + } + ++#ifdef LEGACY_FLAC + if ((state == FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM) || + (state == FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR) || + (state == FLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR) || + (state == FLAC__SEEKABLE_STREAM_DECODER_READ_ERROR) || + (state == FLAC__SEEKABLE_STREAM_DECODER_SEEK_ERROR)) + break; ++#else ++ if (state > FLAC__STREAM_DECODER_READ_FRAME) ++ break; ++#endif + + #if defined(HAVE_FLAC_DECODER_SKIP) ++#ifdef LEGACY_FLAC + ok = FLAC__seekable_stream_decoder_skip_single_frame(decoder); + #else ++ ok = FLAC__stream_decoder_skip_single_frame(decoder); ++#endif ++#else + ok = FLAC__seekable_stream_decoder_process_single(decoder); + #endif + } +@@ -283,8 +396,13 @@ flac_reader_c::parse_file() { + if ((blocks.size() == 0) || (blocks[0].type != FLAC_BLOCK_TYPE_HEADERS)) + mxerror(FPFX "Could not read all header packets.\n"); + ++#ifdef LEGACY_FLAC + FLAC__seekable_stream_decoder_reset(decoder); + FLAC__seekable_stream_decoder_delete(decoder); ++#else ++ FLAC__stream_decoder_reset(decoder); ++ FLAC__stream_decoder_delete(decoder); ++#endif + + file->setFilePointer(0); + blocks[0].len -= 4; +@@ -321,15 +439,26 @@ flac_reader_c::read(generic_packetizer_c + return FILE_STATUS_MOREDATA; + } + ++#ifdef LEGACY_FLAC + FLAC__SeekableStreamDecoderReadStatus + flac_reader_c::read_cb(FLAC__byte buffer[], +- unsigned *bytes) { ++ unsigned *bytes) ++#else ++FLAC__StreamDecoderReadStatus ++flac_reader_c::read_cb(FLAC__byte buffer[], ++ size_t *bytes) ++#endif ++{ + unsigned bytes_read, wanted_bytes; + + wanted_bytes = *bytes; + bytes_read = file->read((unsigned char *)buffer, wanted_bytes); + *bytes = bytes_read; ++#ifdef LEGACY_FLAC + return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK; ++#else ++ return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; ++#endif + } + + FLAC__StreamDecoderWriteStatus +@@ -372,24 +501,49 @@ flac_reader_c::error_cb(FLAC__StreamDeco + mxerror(FPFX "Error parsing the file: %d\n", (int)status); + } + ++#ifdef LEGACY_FLAC + FLAC__SeekableStreamDecoderSeekStatus ++#else ++FLAC__StreamDecoderSeekStatus ++#endif + flac_reader_c::seek_cb(uint64_t new_pos) { + file->setFilePointer(new_pos, seek_beginning); + if (file->getFilePointer() == new_pos) ++#ifdef LEGACY_FLAC + return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK; + return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR; ++#else ++ return FLAC__STREAM_DECODER_SEEK_STATUS_OK; ++ return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; ++#endif + } + ++#ifdef LEGACY_FLAC + FLAC__SeekableStreamDecoderTellStatus ++#else ++FLAC__StreamDecoderTellStatus ++#endif + flac_reader_c::tell_cb(uint64_t &absolute_byte_offset) { + absolute_byte_offset = file->getFilePointer(); ++#ifdef LEGACY_FLAC + return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK; ++#else ++ return FLAC__STREAM_DECODER_TELL_STATUS_OK; ++#endif + } + ++#ifdef LEGACY_FLAC + FLAC__SeekableStreamDecoderLengthStatus ++#else ++FLAC__StreamDecoderLengthStatus ++#endif + flac_reader_c::length_cb(uint64_t &stream_length) { + stream_length = file_size; ++#ifdef LEGACY_FLAC + return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK; ++#else ++ return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; ++#endif + } + + FLAC__bool diff --git a/multimedia/mkvtoolnix/patches/patch-ag b/multimedia/mkvtoolnix/patches/patch-ag new file mode 100644 index 00000000000..2766ff39300 --- /dev/null +++ b/multimedia/mkvtoolnix/patches/patch-ag @@ -0,0 +1,54 @@ +$NetBSD: patch-ag,v 1.1 2007/01/13 21:58:24 wiz Exp $ + +--- src/input/r_flac.h.orig 2005-02-24 21:05:35.000000000 +0000 ++++ src/input/r_flac.h +@@ -23,7 +23,17 @@ + #if defined(HAVE_FLAC_FORMAT_H) + #include <vector> + ++#include <FLAC/export.h> ++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 ++#define LEGACY_FLAC ++#else ++#undef LEGACY_FLAC ++#endif ++#ifdef LEGACY_FLAC + #include <FLAC/seekable_stream_decoder.h> ++#else ++#include <FLAC/stream_decoder.h> ++#endif + + #include "p_flac.h" + +@@ -59,20 +69,31 @@ public: + + static int probe_file(mm_io_c *io, int64_t size); + ++#ifdef LEGACY_FLAC + virtual FLAC__SeekableStreamDecoderReadStatus + read_cb(FLAC__byte buffer[], unsigned *bytes); ++#else ++ virtual FLAC__StreamDecoderReadStatus ++ read_cb(FLAC__byte buffer[], size_t *bytes); ++#endif + + virtual FLAC__StreamDecoderWriteStatus + write_cb(const FLAC__Frame *frame, const FLAC__int32 * const data[]); + + virtual void metadata_cb(const FLAC__StreamMetadata *metadata); + virtual void error_cb(FLAC__StreamDecoderErrorStatus status); ++#ifdef LEGACY_FLAC + virtual FLAC__SeekableStreamDecoderSeekStatus + seek_cb(uint64_t new_pos); + virtual FLAC__SeekableStreamDecoderTellStatus + tell_cb(uint64_t &absolute_byte_offset); + virtual FLAC__SeekableStreamDecoderLengthStatus + length_cb(uint64_t &stream_length); ++#else ++ virtual FLAC__StreamDecoderSeekStatus seek_cb(uint64_t new_pos); ++ virtual FLAC__StreamDecoderTellStatus tell_cb(uint64_t &absolute_byte_offset); ++ virtual FLAC__StreamDecoderLengthStatus length_cb(uint64_t &stream_length); ++#endif + virtual FLAC__bool eof_cb(); + + protected: diff --git a/multimedia/mkvtoolnix/patches/patch-ah b/multimedia/mkvtoolnix/patches/patch-ah new file mode 100644 index 00000000000..96563df1ec2 --- /dev/null +++ b/multimedia/mkvtoolnix/patches/patch-ah @@ -0,0 +1,53 @@ +$NetBSD: patch-ah,v 1.1 2007/01/13 21:58:24 wiz Exp $ + +--- src/input/r_ogm.cpp.orig 2006-04-28 08:48:49.000000000 +0000 ++++ src/input/r_ogm.cpp +@@ -23,6 +23,11 @@ + #include <vorbis/codec.h> + #if defined(HAVE_FLAC_FORMAT_H) + #include <FLAC/stream_decoder.h> ++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 ++#define LEGACY_FLAC ++#else ++#undef LEGACY_FLAC ++#endif + #endif + #if defined(SYS_WINDOWS) + #include <windows.h> +@@ -102,7 +107,11 @@ extract_vorbis_comments(const memory_cpt + static FLAC__StreamDecoderReadStatus + fhe_read_cb(const FLAC__StreamDecoder *decoder, + FLAC__byte buffer[], ++#ifdef LEGACY_FLAC + unsigned *bytes, ++#else ++ size_t *bytes, ++#endif + void *client_data) { + flac_header_extractor_c *fhe; + ogg_packet op; +@@ -193,6 +202,7 @@ flac_header_extractor_c::flac_header_ext + decoder = FLAC__stream_decoder_new(); + if (decoder == NULL) + mxerror(FPFX "FLAC__stream_decoder_new() failed.\n"); ++#ifdef LEGACY_FLAC + FLAC__stream_decoder_set_client_data(decoder, this); + if (!FLAC__stream_decoder_set_read_callback(decoder, fhe_read_cb)) + mxerror(FPFX "Could not set the read callback.\n"); +@@ -202,10 +212,16 @@ flac_header_extractor_c::flac_header_ext + mxerror(FPFX "Could not set the metadata callback.\n"); + if (!FLAC__stream_decoder_set_error_callback(decoder, fhe_error_cb)) + mxerror(FPFX "Could not set the error callback.\n"); ++#endif + if (!FLAC__stream_decoder_set_metadata_respond_all(decoder)) + mxerror(FPFX "Could not set metadata_respond_all.\n"); ++#ifdef LEGACY_FLAC + if (FLAC__stream_decoder_init(decoder) != + FLAC__STREAM_DECODER_SEARCH_FOR_METADATA) ++#else ++ if (FLAC__stream_decoder_init_stream(decoder, fhe_read_cb, NULL, NULL, NULL, NULL, fhe_write_cb, fhe_metadata_cb, fhe_error_cb, this) != ++ FLAC__STREAM_DECODER_INIT_STATUS_OK) ++#endif + mxerror(FPFX "Could not initialize the FLAC decoder.\n"); + ogg_sync_init(&oy); + } |