From 110a993cc9f893c456e6823ffa3511af0b0e1434 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 6 Mar 2012 16:08:23 +0100 Subject: [PATCH] a52dec: use base class tag handling helper ... so as to ensure these to be handled and sent at proper time. --- ext/a52dec/gsta52dec.c | 30 +++--------------------------- ext/a52dec/gsta52dec.h | 2 -- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/ext/a52dec/gsta52dec.c b/ext/a52dec/gsta52dec.c index 3ada93f188..aeab8a1da1 100644 --- a/ext/a52dec/gsta52dec.c +++ b/ext/a52dec/gsta52dec.c @@ -96,8 +96,6 @@ static gboolean gst_a52dec_parse (GstAudioDecoder * dec, GstAdapter * adapter, gint * offset, gint * length); static GstFlowReturn gst_a52dec_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer); -static GstFlowReturn gst_a52dec_pre_push (GstAudioDecoder * bdec, - GstBuffer ** buffer); static GstFlowReturn gst_a52dec_chain (GstPad * pad, GstBuffer * buffer); @@ -163,7 +161,6 @@ gst_a52dec_class_init (GstA52DecClass * klass) gstbase_class->set_format = GST_DEBUG_FUNCPTR (gst_a52dec_set_format); gstbase_class->parse = GST_DEBUG_FUNCPTR (gst_a52dec_parse); gstbase_class->handle_frame = GST_DEBUG_FUNCPTR (gst_a52dec_handle_frame); - gstbase_class->pre_push = GST_DEBUG_FUNCPTR (gst_a52dec_pre_push); /** * GstA52Dec::drc @@ -282,10 +279,6 @@ gst_a52dec_stop (GstAudioDecoder * dec) a52_free (a52dec->state); a52dec->state = NULL; } - if (a52dec->pending_tags) { - gst_tag_list_free (a52dec->pending_tags); - a52dec->pending_tags = NULL; - } return TRUE; } @@ -463,26 +456,9 @@ gst_a52dec_update_streaminfo (GstA52Dec * a52dec) gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, GST_TAG_BITRATE, (guint) a52dec->bit_rate, NULL); - if (a52dec->pending_tags) { - gst_tag_list_free (a52dec->pending_tags); - a52dec->pending_tags = NULL; - } - - a52dec->pending_tags = taglist; -} - -static GstFlowReturn -gst_a52dec_pre_push (GstAudioDecoder * bdec, GstBuffer ** buffer) -{ - GstA52Dec *a52dec = GST_A52DEC (bdec); - - if (G_UNLIKELY (a52dec->pending_tags)) { - gst_element_found_tags_for_pad (GST_ELEMENT (a52dec), - GST_AUDIO_DECODER_SRC_PAD (a52dec), a52dec->pending_tags); - a52dec->pending_tags = NULL; - } - - return GST_FLOW_OK; + gst_audio_decoder_merge_tags (GST_AUDIO_DECODER (a52dec), taglist, + GST_TAG_MERGE_REPLACE); + gst_tag_list_free (taglist); } static GstFlowReturn diff --git a/ext/a52dec/gsta52dec.h b/ext/a52dec/gsta52dec.h index 44fab5d2c6..0c1dc5f5dc 100644 --- a/ext/a52dec/gsta52dec.h +++ b/ext/a52dec/gsta52dec.h @@ -62,8 +62,6 @@ struct _GstA52Dec { gboolean dynamic_range_compression; sample_t *samples; a52_state_t *state; - - GstTagList *pending_tags; }; struct _GstA52DecClass {