From cdababbc7e8d4a3f6d6ff45fa7c6f49e842e3103 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Sun, 15 Dec 2002 16:05:23 +0000 Subject: =?UTF-8?q?update=20metainfo=20more=20often,=20patch=20inspired=20?= =?UTF-8?q?by=20Marco=20Z=C3=BChlke?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CVS patchset: 3540 CVS date: 2002/12/15 16:05:23 --- src/liba52/xine_decoder.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src') 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"); -- cgit v1.2.3