mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
audioencoder: send tag event after pending events
... which probably includes a pending newsegment event.
This commit is contained in:
parent
89f6720545
commit
803b65613b
1 changed files with 16 additions and 15 deletions
|
@ -490,21 +490,6 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf,
|
||||||
|
|
||||||
GST_AUDIO_ENCODER_STREAM_LOCK (enc);
|
GST_AUDIO_ENCODER_STREAM_LOCK (enc);
|
||||||
|
|
||||||
if (G_UNLIKELY (enc->priv->tags)) {
|
|
||||||
GstTagList *tags;
|
|
||||||
|
|
||||||
/* add codec info to pending tags */
|
|
||||||
tags = enc->priv->tags;
|
|
||||||
/* no more pending */
|
|
||||||
enc->priv->tags = NULL;
|
|
||||||
gst_pb_utils_add_codec_description_to_tag_list (tags, GST_TAG_CODEC,
|
|
||||||
GST_PAD_CAPS (enc->srcpad));
|
|
||||||
gst_pb_utils_add_codec_description_to_tag_list (tags, GST_TAG_AUDIO_CODEC,
|
|
||||||
GST_PAD_CAPS (enc->srcpad));
|
|
||||||
GST_DEBUG_OBJECT (enc, "sending tags %" GST_PTR_FORMAT, tags);
|
|
||||||
gst_element_found_tags_for_pad (GST_ELEMENT (enc), enc->srcpad, tags);
|
|
||||||
}
|
|
||||||
|
|
||||||
GST_LOG_OBJECT (enc, "accepting %d bytes encoded data as %d samples",
|
GST_LOG_OBJECT (enc, "accepting %d bytes encoded data as %d samples",
|
||||||
buf ? GST_BUFFER_SIZE (buf) : -1, samples);
|
buf ? GST_BUFFER_SIZE (buf) : -1, samples);
|
||||||
|
|
||||||
|
@ -523,6 +508,22 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf,
|
||||||
g_list_free (pending_events);
|
g_list_free (pending_events);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* send after pending events, which likely includes newsegment event */
|
||||||
|
if (G_UNLIKELY (enc->priv->tags)) {
|
||||||
|
GstTagList *tags;
|
||||||
|
|
||||||
|
/* add codec info to pending tags */
|
||||||
|
tags = enc->priv->tags;
|
||||||
|
/* no more pending */
|
||||||
|
enc->priv->tags = NULL;
|
||||||
|
gst_pb_utils_add_codec_description_to_tag_list (tags, GST_TAG_CODEC,
|
||||||
|
GST_PAD_CAPS (enc->srcpad));
|
||||||
|
gst_pb_utils_add_codec_description_to_tag_list (tags, GST_TAG_AUDIO_CODEC,
|
||||||
|
GST_PAD_CAPS (enc->srcpad));
|
||||||
|
GST_DEBUG_OBJECT (enc, "sending tags %" GST_PTR_FORMAT, tags);
|
||||||
|
gst_element_found_tags_for_pad (GST_ELEMENT (enc), enc->srcpad, tags);
|
||||||
|
}
|
||||||
|
|
||||||
/* remove corresponding samples from input */
|
/* remove corresponding samples from input */
|
||||||
if (samples < 0)
|
if (samples < 0)
|
||||||
samples = (enc->priv->offset / ctx->info.bpf);
|
samples = (enc->priv->offset / ctx->info.bpf);
|
||||||
|
|
Loading…
Reference in a new issue