From f5e73d28080b1afbe5bc2c60b9a135ece45d6907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 1 Sep 2014 17:41:50 +0300 Subject: [PATCH] amcaudiodec: Remove hack for Google MP3 decoder The first buffer does not contain more garbage than any other MP3 decoder outputs and we don't really know how much we have to drop or not. After this change the output has the same duration as with mad. --- sys/androidmedia/gstamcaudiodec.c | 12 ------------ sys/androidmedia/gstamcaudiodec.h | 3 --- 2 files changed, 15 deletions(-) diff --git a/sys/androidmedia/gstamcaudiodec.c b/sys/androidmedia/gstamcaudiodec.c index eabe27d4b9..a94e5698af 100644 --- a/sys/androidmedia/gstamcaudiodec.c +++ b/sys/androidmedia/gstamcaudiodec.c @@ -490,7 +490,6 @@ retry: buffer_info.flags); is_eos = ! !(buffer_info.flags & BUFFER_FLAG_END_OF_STREAM); - self->n_buffers++; if (buffer_info.size > 0) { GstAmcAudioDecClass *klass = GST_AMC_AUDIO_DEC_GET_CLASS (self); @@ -506,16 +505,6 @@ retry: if (idx >= self->n_output_buffers) goto invalid_buffer_index; - if (strcmp (klass->codec_info->name, "OMX.google.mp3.decoder") == 0) { - /* Google's MP3 decoder outputs garbage in the first output buffer - * so we just drop it here */ - if (self->n_buffers == 1) { - GST_DEBUG_OBJECT (self, - "Skipping first buffer of Google MP3 decoder output"); - goto done; - } - } - if (buffer_info.size % self->info.bpf != 0) goto invalid_buffer_size; @@ -934,7 +923,6 @@ gst_amc_audio_dec_set_format (GstAudioDecoder * decoder, GstCaps * caps) GST_STR_NULL (format_string)); g_free (format_string); - self->n_buffers = 0; if (!gst_amc_codec_configure (self->codec, format, 0, &err)) { GST_ERROR_OBJECT (self, "Failed to configure codec"); GST_ELEMENT_ERROR_FROM_ERROR (self, err); diff --git a/sys/androidmedia/gstamcaudiodec.h b/sys/androidmedia/gstamcaudiodec.h index 6a09017b78..6c6124ed0c 100644 --- a/sys/androidmedia/gstamcaudiodec.h +++ b/sys/androidmedia/gstamcaudiodec.h @@ -82,9 +82,6 @@ struct _GstAmcAudioDec gboolean drained; GstFlowReturn downstream_flow_ret; - - /* Output buffers counter */ - gint n_buffers; }; struct _GstAmcAudioDecClass