mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 02:15:31 +00:00
a52dec: use base class tag handling helper
... so as to ensure these to be handled and sent at proper time.
This commit is contained in:
parent
6e9a534223
commit
110a993cc9
2 changed files with 3 additions and 29 deletions
|
@ -96,8 +96,6 @@ static gboolean gst_a52dec_parse (GstAudioDecoder * dec, GstAdapter * adapter,
|
||||||
gint * offset, gint * length);
|
gint * offset, gint * length);
|
||||||
static GstFlowReturn gst_a52dec_handle_frame (GstAudioDecoder * dec,
|
static GstFlowReturn gst_a52dec_handle_frame (GstAudioDecoder * dec,
|
||||||
GstBuffer * buffer);
|
GstBuffer * buffer);
|
||||||
static GstFlowReturn gst_a52dec_pre_push (GstAudioDecoder * bdec,
|
|
||||||
GstBuffer ** buffer);
|
|
||||||
|
|
||||||
static GstFlowReturn gst_a52dec_chain (GstPad * pad, 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->set_format = GST_DEBUG_FUNCPTR (gst_a52dec_set_format);
|
||||||
gstbase_class->parse = GST_DEBUG_FUNCPTR (gst_a52dec_parse);
|
gstbase_class->parse = GST_DEBUG_FUNCPTR (gst_a52dec_parse);
|
||||||
gstbase_class->handle_frame = GST_DEBUG_FUNCPTR (gst_a52dec_handle_frame);
|
gstbase_class->handle_frame = GST_DEBUG_FUNCPTR (gst_a52dec_handle_frame);
|
||||||
gstbase_class->pre_push = GST_DEBUG_FUNCPTR (gst_a52dec_pre_push);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstA52Dec::drc
|
* GstA52Dec::drc
|
||||||
|
@ -282,10 +279,6 @@ gst_a52dec_stop (GstAudioDecoder * dec)
|
||||||
a52_free (a52dec->state);
|
a52_free (a52dec->state);
|
||||||
a52dec->state = NULL;
|
a52dec->state = NULL;
|
||||||
}
|
}
|
||||||
if (a52dec->pending_tags) {
|
|
||||||
gst_tag_list_free (a52dec->pending_tags);
|
|
||||||
a52dec->pending_tags = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -463,26 +456,9 @@ gst_a52dec_update_streaminfo (GstA52Dec * a52dec)
|
||||||
gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, GST_TAG_BITRATE,
|
gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, GST_TAG_BITRATE,
|
||||||
(guint) a52dec->bit_rate, NULL);
|
(guint) a52dec->bit_rate, NULL);
|
||||||
|
|
||||||
if (a52dec->pending_tags) {
|
gst_audio_decoder_merge_tags (GST_AUDIO_DECODER (a52dec), taglist,
|
||||||
gst_tag_list_free (a52dec->pending_tags);
|
GST_TAG_MERGE_REPLACE);
|
||||||
a52dec->pending_tags = NULL;
|
gst_tag_list_free (taglist);
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
|
|
|
@ -62,8 +62,6 @@ struct _GstA52Dec {
|
||||||
gboolean dynamic_range_compression;
|
gboolean dynamic_range_compression;
|
||||||
sample_t *samples;
|
sample_t *samples;
|
||||||
a52_state_t *state;
|
a52_state_t *state;
|
||||||
|
|
||||||
GstTagList *pending_tags;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstA52DecClass {
|
struct _GstA52DecClass {
|
||||||
|
|
Loading…
Reference in a new issue