SOURCES: mythplugins-flac.patch (NEW) - three chunks from myth cvs...

glen glen at pld-linux.org
Sun Mar 4 15:47:33 CET 2007


Author: glen                         Date: Sun Mar  4 14:47:33 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- three chunks from myth cvs branches/release-0-20-fixes

---- Files affected:
SOURCES:
   mythplugins-flac.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/mythplugins-flac.patch
diff -u /dev/null SOURCES/mythplugins-flac.patch:1.1
--- /dev/null	Sun Mar  4 15:47:33 2007
+++ SOURCES/mythplugins-flac.patch	Sun Mar  4 15:47:28 2007
@@ -0,0 +1,514 @@
+Index: /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacencoder.h
+===================================================================
+--- /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacencoder.h (revision 5420)
++++ /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacencoder.h (revision 12811)
+@@ -5,5 +5,72 @@
+ 
+ #define HAVE_INTTYPES_H
+-#include <FLAC/file_encoder.h>
++
++#include <FLAC/export.h>
++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7
++  /* FLAC 1.0.4 to 1.1.2 */
++  #include <FLAC/file_encoder.h>
++  #define encoder_new() FLAC__file_encoder_new()
++  #define encoder_setup(enc, streamable_subset, do_mid_side_stereo, \
++            loose_mid_side_stereo, channels, bits_per_sample, \
++            sample_rate, blocksize, max_lpc_order, \
++            qlp_coeff_precision, do_qlp_coeff_prec_search, \
++            do_escape_coding, do_exhaustive_model_search, \
++            min_residual_partition_order, max_residual_partition_order, \
++            rice_parameter_search_dist) \
++            { \
++              FLAC__file_encoder_set_streamable_subset(enc, streamable_subset) \
++              FLAC__file_encoder_set_do_mid_side_stereo(enc, do_mid_side_stereo) \
++              FLAC__file_encoder_set_loose_mid_side_stereo(enc, loose_mid_side_stereo) \
++              FLAC__file_encoder_set_channels(enc, channels) \
++              FLAC__file_encoder_set_bits_per_sample(enc, bits_per_sample) \
++              FLAC__file_encoder_set_sample_rate(enc, sample_rate) \
++              FLAC__file_encoder_set_blocksize(enc, blocksize) \
++              FLAC__file_encoder_set_max_lpc_order(enc, max_lpc_order) \
++              FLAC__file_encoder_set_qlp_coeff_precision(enc, qlp_coeff_precision) \
++              FLAC__file_encoder_set_do_qlp_coeff_prec_search(enc, do_qlp_coeff_prec_search) \
++              FLAC__file_encoder_set_do_escape_coding(enc, do_escape_coding) \
++              FLAC__file_encoder_set_do_exhaustive_model_search(enc, do_exhaustive_model_search) \
++              FLAC__file_encoder_set_min_residual_partition_order(enc, min_residual_partition_order) \
++              FLAC__file_encoder_set_max_residual_partition_order(enc, max_residual_partition_order) \
++              FLAC__file_encoder_set_rice_parameter_search_dist(enc, rice_parameter_search_dist) \
++            }
++  #define encoder_finish(enc) FLAC__file_encoder_finish(enc)
++  #define encoder_delete(enc) FLAC__file_encoder_delete(enc)
++  #define encoder_process(enc, data, index) FLAC__file_encoder_process(enc, data, index)
++  #define FLAC_ENCODER FLAC__FileEncoder
++#else 
++  /* FLAC 1.1.3 and up */
++  #define NEWFLAC
++  #include <FLAC/stream_encoder.h>
++  #define encoder_new() FLAC__stream_encoder_new()
++  #define encoder_setup(enc, streamable_subset, do_mid_side_stereo, \
++            loose_mid_side_stereo, channels, bits_per_sample, \
++            sample_rate, blocksize, max_lpc_order, \
++            qlp_coeff_precision, do_qlp_coeff_prec_search, \
++            do_escape_coding, do_exhaustive_model_search, \
++            min_residual_partition_order, max_residual_partition_order, \
++            rice_parameter_search_dist) \
++            { \
++              FLAC__stream_encoder_set_streamable_subset(enc, streamable_subset); \
++              FLAC__stream_encoder_set_do_mid_side_stereo(enc, do_mid_side_stereo); \
++              FLAC__stream_encoder_set_loose_mid_side_stereo(enc, loose_mid_side_stereo); \
++              FLAC__stream_encoder_set_channels(enc, channels); \
++              FLAC__stream_encoder_set_bits_per_sample(enc, bits_per_sample); \
++              FLAC__stream_encoder_set_sample_rate(enc, sample_rate); \
++              FLAC__stream_encoder_set_blocksize(enc, blocksize); \
++              FLAC__stream_encoder_set_max_lpc_order(enc, max_lpc_order); \
++              FLAC__stream_encoder_set_qlp_coeff_precision(enc, qlp_coeff_precision); \
++              FLAC__stream_encoder_set_do_qlp_coeff_prec_search(enc, do_qlp_coeff_prec_search); \
++              FLAC__stream_encoder_set_do_escape_coding(enc, do_escape_coding); \
++              FLAC__stream_encoder_set_do_exhaustive_model_search(enc, do_exhaustive_model_search); \
++              FLAC__stream_encoder_set_min_residual_partition_order(enc, min_residual_partition_order); \
++              FLAC__stream_encoder_set_max_residual_partition_order(enc, max_residual_partition_order); \
++              FLAC__stream_encoder_set_rice_parameter_search_dist(enc, rice_parameter_search_dist); \
++            }
++  #define encoder_finish(enc) FLAC__stream_encoder_finish(enc)
++  #define encoder_delete(enc) FLAC__stream_encoder_delete(enc)
++  #define encoder_process(enc, data, index) FLAC__stream_encoder_process(enc, data, index)
++  #define FLAC_ENCODER FLAC__StreamEncoder
++#endif
+ 
+ #include "encoder.h"
+@@ -22,5 +89,5 @@
+ 
+   private:
+-    FLAC__FileEncoder *encoder;
++    FLAC_ENCODER *encoder;
+     unsigned int sampleindex;
+     FLAC__int32 inputin[NUM_CHANNELS][MAX_SAMPLES];
+Index: /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacdecoder.h
+===================================================================
+--- /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacdecoder.h (revision 7611)
++++ /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacdecoder.h (revision 12811)
+@@ -4,4 +4,71 @@
+ #define HAVE_INTTYPES_H
+ #include <FLAC/all.h>
++#include <FLAC/export.h>
++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7
++  /* FLAC 1.0.4 to 1.1.2 */
++  #define StreamDecoderReadStatus FLAC__SeekableStreamDecoderReadStatus
++  #define StreamDecoder FLAC__SeekableStreamDecoder
++  #define STREAM_DECODER_READ_STATUS_ERROR FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR
++  #define STREAM_DECODER_READ_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK
++  #define StreamDecoderSeekStatus FLAC__SeekableStreamDecoderSeekStatus
++  #define STREAM_DECODER_SEEK_STATUS_ERROR FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR
++  #define STREAM_DECODER_SEEK_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK
++  #define StreamDecoderTellStatus FLAC__SeekableStreamDecoderTellStatus
++  #define STREAM_DECODER_TELL_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK
++  #define StreamDecoderLengthStatus FLAC__SeekableStreamDecoderLengthStatus
++  #define STREAM_DECODER_LENGTH_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK
++  #define FileDecoder FLAC__FileDecoder
++  #define decoder_new() FLAC__seekable_stream_decoder_new()
++  #define decoder_set_md5_checking(dec, op) \
++          FLAC__seekable_stream_decoder_set_md5_checking(dec, op)
++  #define decoder_setup(dec, read, seek, tell, length, \
++                        eof, write, metadata, error, data) \
++          { \
++            FLAC__seekable_stream_decoder_set_read_callback(dec, read); \
++            FLAC__seekable_stream_decoder_set_seek_callback(dec, seek); \
++            FLAC__seekable_stream_decoder_set_tell_callback(dec, tell); \
++            FLAC__seekable_stream_decoder_set_length_callback(dec, length); \
++            FLAC__seekable_stream_decoder_set_eof_callback(dec, eof); \
++            FLAC__seekable_stream_decoder_set_write_callback(dec, write); \
++            FLAC__seekable_stream_decoder_set_metadata_callback(dec, metadata); \
++            FLAC__seekable_stream_decoder_set_error_callback(dec, error); \
++            FLAC__seekable_stream_decoder_set_client_data(dec, data); \
++          }
++  #define decoder_process_metadata FLAC__seekable_stream_decoder_process_until_end_of_metadata
++  #define decoder_finish FLAC__seekable_stream_decoder_finish
++  #define decoder_delete FLAC__seekable_stream_decoder_delete
++  #define DecoderState FLAC__SeekableStreamDecoderState
++  #define decoder_seek_absolute FLAC__seekable_stream_decoder_seek_absolute
++  #define decoder_process_single FLAC__seekable_stream_decoder_process_single
++  #define decoder_get_state FLAC__seekable_stream_decoder_get_state
++#else
++  /* FLAC 1.1.3 and up */
++  #define NEWFLAC
++  #define StreamDecoderReadStatus FLAC__StreamDecoderReadStatus
++  #define StreamDecoder FLAC__StreamDecoder
++  #define STREAM_DECODER_READ_STATUS_ERROR FLAC__STREAM_DECODER_READ_STATUS_ABORT
++  #define STREAM_DECODER_READ_STATUS_OK FLAC__STREAM_DECODER_READ_STATUS_CONTINUE
++  #define StreamDecoderSeekStatus FLAC__StreamDecoderSeekStatus
++  #define STREAM_DECODER_SEEK_STATUS_ERROR FLAC__STREAM_DECODER_SEEK_STATUS_ERROR
++  #define STREAM_DECODER_SEEK_STATUS_OK FLAC__STREAM_DECODER_SEEK_STATUS_OK
++  #define StreamDecoderTellStatus FLAC__StreamDecoderTellStatus
++  #define STREAM_DECODER_TELL_STATUS_OK FLAC__STREAM_DECODER_TELL_STATUS_OK
++  #define StreamDecoderLengthStatus FLAC__StreamDecoderLengthStatus
++  #define STREAM_DECODER_LENGTH_STATUS_OK FLAC__STREAM_DECODER_LENGTH_STATUS_OK
++  #define FileDecoder FLAC__StreamDecoder
++  #define decoder_new() FLAC__stream_decoder_new()
++  #define decoder_set_md5_checking(dec, op) \
++          FLAC__stream_decoder_set_md5_checking(dec, op)
++  #define decoder_setup(decoder, read, seek, tell, length, eof, write, metadata, error, data) \
++          FLAC__stream_decoder_init_stream(decoder, read, seek, tell, length, \
++                                           eof, write, metadata, error, data)
++  #define decoder_process_metadata FLAC__stream_decoder_process_until_end_of_metadata
++  #define decoder_finish FLAC__stream_decoder_finish
++  #define decoder_delete FLAC__stream_decoder_delete
++  #define DecoderState FLAC__StreamDecoderState
++  #define decoder_seek_absolute FLAC__stream_decoder_seek_absolute
++  #define decoder_process_single FLAC__stream_decoder_process_single
++  #define decoder_get_state FLAC__stream_decoder_get_state
++#endif
+ 
+ #include "decoder.h"
+@@ -36,5 +103,5 @@
+     ulong output_bytes, output_at;
+ 
+-    FLAC__SeekableStreamDecoder *decoder;
++    StreamDecoder *decoder;
+ 
+     unsigned int bks;
+Index: /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacencoder.cpp
+===================================================================
+--- /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacencoder.cpp (revision 5215)
++++ /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacencoder.cpp (revision 12811)
+@@ -10,5 +10,13 @@
+ #include "metaioflacvorbiscomment.h"
+ 
+-#include <FLAC/file_encoder.h>
++#include <FLAC/export.h>
++#if !defined(NEWFLAC)
++  /* FLAC 1.0.4 to 1.1.2 */
++  #include <FLAC/file_encoder.h>
++#else
++  /* FLAC 1.1.3 and up */
++  #include <FLAC/stream_encoder.h>
++#endif
++
+ #include <FLAC/assert.h>
+ #include <mythtv/mythcontext.h>
+@@ -20,40 +28,45 @@
+     sampleindex = 0;
+ 
+-    int blocksize = 4608;
+-    bool do_exhaustive_model_search = false;
+-    bool do_escape_coding = false;
++    bool streamable_subset = true;
+     bool do_mid_side = true;
+     bool loose_mid_side = false;
++    int bits_per_sample = 16;
++    int sample_rate = 44100;
++    int blocksize = 4608;
++    int max_lpc_order = 8;
+     int qlp_coeff_precision = 0;
+-    int min_residual_partition_order = 3, max_residual_partition_order = 3;
++    bool qlp_coeff_prec_search = false;
++    bool do_escape_coding = false;
++    bool do_exhaustive_model_search = false;
++    int min_residual_partition_order = 3;
++    int max_residual_partition_order = 3;
+     int rice_parameter_search_dist = 0;
+-    int max_lpc_order = 8;
+ 
+-    encoder = FLAC__file_encoder_new();
++    encoder = encoder_new();
++    encoder_setup(encoder, streamable_subset, \
++                  do_mid_side, loose_mid_side, \
++                  NUM_CHANNELS, bits_per_sample, \
++                  sample_rate, blocksize, \
++                  max_lpc_order, qlp_coeff_precision, \
++                  qlp_coeff_prec_search, do_escape_coding, \
++                  do_exhaustive_model_search, \
++                  min_residual_partition_order, \
++                  max_residual_partition_order, \
++                  rice_parameter_search_dist);
+ 
+-    FLAC__file_encoder_set_streamable_subset(encoder, true);
+-    FLAC__file_encoder_set_do_mid_side_stereo(encoder, do_mid_side);
+-    FLAC__file_encoder_set_loose_mid_side_stereo(encoder, loose_mid_side);
+-    FLAC__file_encoder_set_channels(encoder, NUM_CHANNELS);
+-    FLAC__file_encoder_set_bits_per_sample(encoder, 16);
+-    FLAC__file_encoder_set_sample_rate(encoder, 44100);
+-    FLAC__file_encoder_set_blocksize(encoder, blocksize);
+-    FLAC__file_encoder_set_max_lpc_order(encoder, max_lpc_order);
+-    FLAC__file_encoder_set_qlp_coeff_precision(encoder, qlp_coeff_precision);
+-    FLAC__file_encoder_set_do_qlp_coeff_prec_search(encoder, false);
+-    FLAC__file_encoder_set_do_escape_coding(encoder, do_escape_coding);
+-    FLAC__file_encoder_set_do_exhaustive_model_search(encoder, 
+-                                                    do_exhaustive_model_search);
+-    FLAC__file_encoder_set_min_residual_partition_order(encoder, 
+-                                                  min_residual_partition_order);
+-    FLAC__file_encoder_set_max_residual_partition_order(encoder, 
+-                                                  max_residual_partition_order);
+-    FLAC__file_encoder_set_rice_parameter_search_dist(encoder, 
+-                                                    rice_parameter_search_dist);
+-
++#if !defined(NEWFLAC)
++    /* FLAC 1.0.4 to 1.1.2 */
+     FLAC__file_encoder_set_filename(encoder, outfile.local8Bit());
+ 
+     int ret = FLAC__file_encoder_init(encoder);
+     if (ret != FLAC__FILE_ENCODER_OK)
++#else
++    /* FLAC 1.1.3 and up */
++    int ret = FLAC__stream_encoder_init_file(encoder,
++                           outfile.local8Bit(),
++                           NULL,
++                           NULL);
++    if(ret != FLAC__STREAM_ENCODER_INIT_STATUS_OK)
++#endif
+     {
+         VERBOSE(VB_GENERAL, QString("Error initializing FLAC encoder."
+@@ -71,6 +84,6 @@
+     if (encoder)
+     {
+-        FLAC__file_encoder_finish(encoder);
+-        FLAC__file_encoder_delete(encoder);
++        encoder_finish(encoder);
++        encoder_delete(encoder);
+     }
+ 
+@@ -103,7 +116,6 @@
+         if(sampleindex == MAX_SAMPLES || (length == 0 && sampleindex > 0) ) 
+         {
+-            if (!FLAC__file_encoder_process(encoder,
+-                                            (const FLAC__int32 * const *) input,
+-                                            sampleindex))
++            if (!encoder_process(encoder, (const FLAC__int32 * const *) input,
++                                 sampleindex))
+             {
+                 VERBOSE(VB_GENERAL, QString("Failed to write flac data."
+Index: /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacdecoder.cpp
+===================================================================
+--- /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacdecoder.cpp (revision 9718)
++++ /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacdecoder.cpp (revision 12811)
+@@ -18,5 +18,5 @@
+ #include <qtimer.h>
+ 
+-static FLAC__SeekableStreamDecoderReadStatus flacread(const FLAC__SeekableStreamDecoder *decoder, FLAC__byte bufferp[], unsigned *bytes, void *client_data)
++static StreamDecoderReadStatus flacread(const StreamDecoder *decoder, FLAC__byte bufferp[], unsigned *bytes, void *client_data)
+ {
+     decoder = decoder;
+@@ -27,12 +27,12 @@
+     if (len == -1)
+     {
+-        return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR;
++        return STREAM_DECODER_READ_STATUS_ERROR;
+     }
+    
+     *bytes = len;
+-    return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
+-}
+-
+-static FLAC__SeekableStreamDecoderSeekStatus flacseek(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) 
++    return STREAM_DECODER_READ_STATUS_OK;
++}
++
++static StreamDecoderSeekStatus flacseek(const StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) 
+ {
+     decoder = decoder;
+@@ -40,12 +40,12 @@
+ 
+     if (!dflac->input()->isDirectAccess())
+-        return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
++        return STREAM_DECODER_SEEK_STATUS_ERROR;
+ 
+     if (dflac->input()->at(absolute_byte_offset))
+-        return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
+-    return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
+-}
+-
+-static FLAC__SeekableStreamDecoderTellStatus flactell(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
++        return STREAM_DECODER_SEEK_STATUS_OK;
++    return STREAM_DECODER_SEEK_STATUS_ERROR;
++}
++
++static StreamDecoderTellStatus flactell(const StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
+ {
+     decoder = decoder;
+@@ -55,8 +55,8 @@
+     *absolute_byte_offset = t;
+ 
+-    return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
+-}
+-
+-static FLAC__SeekableStreamDecoderLengthStatus flaclength(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data)
++    return STREAM_DECODER_TELL_STATUS_OK;
++}
++
++static StreamDecoderLengthStatus flaclength(const StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data)
+ {
+     decoder = decoder;
+@@ -65,8 +65,8 @@
+ 
+     *stream_length = dflac->input()->size();
+-    return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
+-}
+-
+-static FLAC__bool flaceof(const FLAC__SeekableStreamDecoder *decoder, void *client_data)
++    return STREAM_DECODER_LENGTH_STATUS_OK;
++}
++
++static FLAC__bool flaceof(const StreamDecoder *decoder, void *client_data)
+ {
+     decoder = decoder;
+@@ -77,5 +77,5 @@
+ }
+ 
+-static FLAC__StreamDecoderWriteStatus flacwrite(const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
++static FLAC__StreamDecoderWriteStatus flacwrite(const StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
+ {
+     decoder = decoder;
+@@ -133,5 +133,5 @@
+ }
+ 
+-static void flacmetadata(const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
++static void flacmetadata(const StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
+ {
+     decoder = decoder;
+@@ -157,9 +157,9 @@
+ }
+ 
+-static void flacerror(const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
+-{
+-    decoder = decoder;
+-
+-    FLAC__FileDecoder *file_decoder = (FLAC__FileDecoder *)client_data;
++static void flacerror(const StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
++{
++    decoder = decoder;
++
++    FileDecoder *file_decoder = (FileDecoder *)client_data;
+ 
+     file_decoder = file_decoder;
+@@ -263,15 +263,8 @@
+     }
+ 
+-    decoder = FLAC__seekable_stream_decoder_new();
+-    FLAC__seekable_stream_decoder_set_md5_checking(decoder, false);
+-    FLAC__seekable_stream_decoder_set_read_callback(decoder, flacread);
+-    FLAC__seekable_stream_decoder_set_seek_callback(decoder, flacseek);
+-    FLAC__seekable_stream_decoder_set_tell_callback(decoder, flactell);
+-    FLAC__seekable_stream_decoder_set_length_callback(decoder, flaclength);
+-    FLAC__seekable_stream_decoder_set_eof_callback(decoder, flaceof);
+-    FLAC__seekable_stream_decoder_set_write_callback(decoder, flacwrite);
+-    FLAC__seekable_stream_decoder_set_metadata_callback(decoder, flacmetadata);
+-    FLAC__seekable_stream_decoder_set_error_callback(decoder, flacerror);
+-    FLAC__seekable_stream_decoder_set_client_data(decoder, this);
++    decoder = decoder_new();
++    decoder_set_md5_checking(decoder, false);
++    decoder_setup(decoder, flacread, flacseek, flactell, flaclength, \
++                        flaceof, flacwrite, flacmetadata, flacerror, this);
+ 
+     freq = 0;
+@@ -282,6 +275,8 @@
+     totalTime = totalTime < 0 ? 0 : totalTime;
+ 
++#if !defined(NEWFLAC)
+     FLAC__seekable_stream_decoder_init(decoder);
+-    FLAC__seekable_stream_decoder_process_until_end_of_metadata(decoder);
++#endif
++    decoder_process_metadata(decoder);
+ 
+     inited = TRUE;
+@@ -296,6 +291,6 @@
+ void FlacDecoder::deinit()
+ {
+-    FLAC__seekable_stream_decoder_finish(decoder);
+-    FLAC__seekable_stream_decoder_delete(decoder);
++    decoder_finish(decoder);
++    decoder_delete(decoder);
+ 
+     if (input()->isOpen())
+@@ -331,5 +326,5 @@
+ 
+     bool flacok = true;
+-    FLAC__SeekableStreamDecoderState decoderstate;
++    DecoderState decoderstate;
+ 
+     while (! done && ! finish) {
+@@ -341,10 +336,10 @@
+             if (sample > totalsamples - 50)
+                 sample = totalsamples - 50;
+-            FLAC__seekable_stream_decoder_seek_absolute(decoder, sample);
++            decoder_seek_absolute(decoder, sample);
+             seekTime = -1.0;
+         }
+ 
+-        flacok = FLAC__seekable_stream_decoder_process_single(decoder);
+-        decoderstate = FLAC__seekable_stream_decoder_get_state(decoder);
++        flacok = decoder_process_single(decoder);
++        decoderstate = decoder_get_state(decoder);
+ 
+         if (decoderstate == 0 || decoderstate == 1)
+Index: /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacencoder.h
+===================================================================
+--- /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacencoder.h (revision 12811)
++++ /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacencoder.h (revision 12824)
+@@ -19,19 +19,19 @@
+             rice_parameter_search_dist) \
+             { \
+-              FLAC__file_encoder_set_streamable_subset(enc, streamable_subset) \
+-              FLAC__file_encoder_set_do_mid_side_stereo(enc, do_mid_side_stereo) \
+-              FLAC__file_encoder_set_loose_mid_side_stereo(enc, loose_mid_side_stereo) \
+-              FLAC__file_encoder_set_channels(enc, channels) \
+-              FLAC__file_encoder_set_bits_per_sample(enc, bits_per_sample) \
+-              FLAC__file_encoder_set_sample_rate(enc, sample_rate) \
+-              FLAC__file_encoder_set_blocksize(enc, blocksize) \
+-              FLAC__file_encoder_set_max_lpc_order(enc, max_lpc_order) \
+-              FLAC__file_encoder_set_qlp_coeff_precision(enc, qlp_coeff_precision) \
+-              FLAC__file_encoder_set_do_qlp_coeff_prec_search(enc, do_qlp_coeff_prec_search) \
+-              FLAC__file_encoder_set_do_escape_coding(enc, do_escape_coding) \
+-              FLAC__file_encoder_set_do_exhaustive_model_search(enc, do_exhaustive_model_search) \
+-              FLAC__file_encoder_set_min_residual_partition_order(enc, min_residual_partition_order) \
+-              FLAC__file_encoder_set_max_residual_partition_order(enc, max_residual_partition_order) \
+-              FLAC__file_encoder_set_rice_parameter_search_dist(enc, rice_parameter_search_dist) \
++              FLAC__file_encoder_set_streamable_subset(enc, streamable_subset); \
++              FLAC__file_encoder_set_do_mid_side_stereo(enc, do_mid_side_stereo); \
++              FLAC__file_encoder_set_loose_mid_side_stereo(enc, loose_mid_side_stereo); \
++              FLAC__file_encoder_set_channels(enc, channels); \
++              FLAC__file_encoder_set_bits_per_sample(enc, bits_per_sample); \
++              FLAC__file_encoder_set_sample_rate(enc, sample_rate); \
++              FLAC__file_encoder_set_blocksize(enc, blocksize); \
++              FLAC__file_encoder_set_max_lpc_order(enc, max_lpc_order); \
++              FLAC__file_encoder_set_qlp_coeff_precision(enc, qlp_coeff_precision); \
++              FLAC__file_encoder_set_do_qlp_coeff_prec_search(enc, do_qlp_coeff_prec_search); \
++              FLAC__file_encoder_set_do_escape_coding(enc, do_escape_coding); \
++              FLAC__file_encoder_set_do_exhaustive_model_search(enc, do_exhaustive_model_search); \
++              FLAC__file_encoder_set_min_residual_partition_order(enc, min_residual_partition_order); \
++              FLAC__file_encoder_set_max_residual_partition_order(enc, max_residual_partition_order); \
++              FLAC__file_encoder_set_rice_parameter_search_dist(enc, rice_parameter_search_dist); \
+             }
+   #define encoder_finish(enc) FLAC__file_encoder_finish(enc)
+Index: /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacdecoder.h
+===================================================================
+--- /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacdecoder.h (revision 12811)
++++ /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacdecoder.h (revision 12853)
+@@ -42,4 +42,5 @@
+   #define decoder_process_single FLAC__seekable_stream_decoder_process_single
+   #define decoder_get_state FLAC__seekable_stream_decoder_get_state
++  #define bytesSize unsigned
+ #else
+   /* FLAC 1.1.3 and up */
+@@ -70,4 +71,5 @@
+   #define decoder_process_single FLAC__stream_decoder_process_single
+   #define decoder_get_state FLAC__stream_decoder_get_state
++  #define bytesSize size_t
+ #endif
+ 
+Index: /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacdecoder.cpp
+===================================================================
+--- /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacdecoder.cpp (revision 12811)
++++ /branches/release-0-20-fixes/mythplugins/mythmusic/mythmusic/flacdecoder.cpp (revision 12853)
+@@ -18,5 +18,5 @@
+ #include <qtimer.h>
+ 
+-static StreamDecoderReadStatus flacread(const StreamDecoder *decoder, FLAC__byte bufferp[], unsigned *bytes, void *client_data)
++static StreamDecoderReadStatus flacread(const StreamDecoder *decoder, FLAC__byte bufferp[], bytesSize *bytes, void *client_data)
+ {
+     decoder = decoder;
+@@ -265,5 +265,5 @@
+     decoder = decoder_new();
+     decoder_set_md5_checking(decoder, false);
+-    decoder_setup(decoder, flacread, flacseek, flactell, flaclength, \
++    decoder_setup(decoder, flacread, flacseek, flactell, flaclength,
+                         flaceof, flacwrite, flacmetadata, flacerror, this);
+ 
================================================================


More information about the pld-cvs-commit mailing list