diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-12-15 16:05:23 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-12-15 16:05:23 +0000 |
commit | cdababbc7e8d4a3f6d6ff45fa7c6f49e842e3103 (patch) | |
tree | ea757713cb561261dfe1d40666a91d46e10a5ab3 | |
parent | 7bef2dc92ac37e8ab09570d4fb13584afd0c0bf2 (diff) | |
download | xine-lib-cdababbc7e8d4a3f6d6ff45fa7c6f49e842e3103.tar.gz xine-lib-cdababbc7e8d4a3f6d6ff45fa7c6f49e842e3103.tar.bz2 |
update metainfo more often, patch inspired by Marco Zühlke
CVS patchset: 3540
CVS date: 2002/12/15 16:05:23
-rw-r--r-- | src/liba52/xine_decoder.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/liba52/xine_decoder.c b/src/liba52/xine_decoder.c index 9da303df8..08a1ff664 100644 --- a/src/liba52/xine_decoder.c +++ b/src/liba52/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.41 2002/12/14 20:01:53 guenter Exp $ + * $Id: xine_decoder.c,v 1.42 2002/12/15 16:05:23 mroi Exp $ * * stuff needed to turn liba52 into a xine decoder plugin */ @@ -436,6 +436,9 @@ void a52dec_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->sync_todo--; if (this->sync_todo==0) { + int a52_flags_old = this->a52_flags; + int a52_sample_rate_old = this->a52_sample_rate; + int a52_bit_rate_old = this->a52_bit_rate; this->frame_length = a52_syncinfo (this->frame_buffer, &this->a52_flags, @@ -448,17 +451,22 @@ void a52dec_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { if (this->frame_length) { this->frame_todo = this->frame_length - 7; - if (!this->stream->meta_info[XINE_META_INFO_AUDIOCODEC]) { + if (!this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] || + a52_flags_old != this->a52_flags || + a52_sample_rate_old != this->a52_sample_rate || + a52_bit_rate_old != this->a52_bit_rate) { - if ((this->a52_flags & A52_3F2R) && (this->a52_flags & A52_LFE)) + if (((this->a52_flags & A52_CHANNEL_MASK) == A52_3F2R) && (this->a52_flags & A52_LFE)) this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("A/52 5.1"); - else if ((this->a52_flags & A52_2F2R) || (this->a52_flags & A52_3F1R)) + else if (((this->a52_flags & A52_CHANNEL_MASK) == A52_2F2R) || + ((this->a52_flags & A52_CHANNEL_MASK) == A52_3F1R)) this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("A/52 4.0"); - else if ((this->a52_flags & A52_2F1R) || (this->a52_flags & A52_3F)) + else if (((this->a52_flags & A52_CHANNEL_MASK) == A52_2F1R) || + ((this->a52_flags & A52_CHANNEL_MASK) == A52_3F)) this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("A/52 3.0"); - else if (this->a52_flags & A52_STEREO) + else if ((this->a52_flags & A52_CHANNEL_MASK) == A52_STEREO) this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("A/52 2.0"); - else if (this->a52_flags & A52_MONO) + else if ((this->a52_flags & A52_CHANNEL_MASK) == A52_MONO) this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("A/52 1.0"); else this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("A/52"); |