1 From 68fa1b1425ad2c5f7c5013d0943153a8a6d0934e Mon Sep 17 00:00:00 2001
2 From: Jian Li <lj.qfy.sh@gmail.com>
3 Date: Wed, 24 Sep 2014 17:21:02 +0800
4 Subject: [PATCH] taglist not send to down stream if all the frame corrupted
6 https://bugzilla.gnome.org/show_bug.cgi?id=737246
8 Upstream status: Pending
10 Signed-off-by: Jian Li <lj.qfy.sh@gmail.com>
12 gst-libs/gst/audio/gstaudiodecoder.c | 9 +++++++++
13 gst-libs/gst/video/gstvideodecoder.c | 8 ++++++++
14 2 files changed, 17 insertions(+)
16 diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c
17 index 3504678..3d69efe 100644
18 --- a/gst-libs/gst/audio/gstaudiodecoder.c
19 +++ b/gst-libs/gst/audio/gstaudiodecoder.c
20 @@ -2083,6 +2083,15 @@ gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event)
21 gst_audio_decoder_drain (dec);
22 GST_AUDIO_DECODER_STREAM_UNLOCK (dec);
24 + /* send taglist if no valid frame is decoded util EOS */
25 + if (dec->priv->taglist && dec->priv->taglist_changed) {
26 + GST_DEBUG_OBJECT (dec, "codec tag %" GST_PTR_FORMAT, dec->priv->taglist);
27 + if (!gst_tag_list_is_empty (dec->priv->taglist))
28 + gst_audio_decoder_push_event (dec,
29 + gst_event_new_tag (gst_tag_list_ref (dec->priv->taglist)));
30 + dec->priv->taglist_changed = FALSE;
33 /* Forward EOS because no buffer or serialized event will come after
34 * EOS and nothing could trigger another _finish_frame() call. */
35 ret = gst_audio_decoder_push_event (dec, event);
36 diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c
37 index dd8abe3..d9bfe4d 100644
38 --- a/gst-libs/gst/video/gstvideodecoder.c
39 +++ b/gst-libs/gst/video/gstvideodecoder.c
40 @@ -1024,6 +1024,14 @@ gst_video_decoder_sink_event_default (GstVideoDecoder * decoder,
41 * parent class' ::sink_event() until a later time.
43 forward_immediate = TRUE;
45 + /* send taglist if no valid frame is decoded util EOS */
46 + if (decoder->priv->tags && decoder->priv->tags_changed) {
47 + gst_video_decoder_push_event (decoder,
48 + gst_event_new_tag (gst_tag_list_ref (decoder->priv->tags)));
49 + decoder->priv->tags_changed = FALSE;