From 4b118b6a18770f6a4612774754366f9d14ca15e6 Mon Sep 17 00:00:00 2001 From: Joungkook Seo Date: Tue, 25 Aug 2015 09:24:05 +0900 Subject: [PATCH] [gstaduiodecoder] Fixed Bug for the case of receiving unsupported non TIME newsegment Modify audiodecoder sink event the same as videodecoder logic. Change-Id: Ia8c4c0c2b55fe6934def573ee5465e44beb62ae8 Signed-off-by: Joungkook Seo --- gst-libs/gst/audio/gstaudiodecoder.c | 14 ++++++++++++++ packaging/gst-plugins-base.spec | 1 + 2 files changed, 15 insertions(+) diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index 19a03b0..7ab3a9a 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -2070,8 +2070,12 @@ gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event) } else { GST_DEBUG_OBJECT (dec, "unsupported format; ignoring"); GST_AUDIO_DECODER_STREAM_UNLOCK (dec); +#ifdef GST_EXT_AUDIODECODER_MODIFICATION + goto newseg_wrong_format; +#else gst_event_unref (event); ret = FALSE; +#endif break; } } @@ -2172,6 +2176,16 @@ gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event) break; } return ret; + +#ifdef GST_EXT_AUDIODECODER_MODIFICATION +newseg_wrong_format: + { + GST_DEBUG_OBJECT (dec, "received non TIME newsegment"); + gst_event_unref (event); + /* SWALLOW EVENT */ + return TRUE; + } +#endif } static gboolean diff --git a/packaging/gst-plugins-base.spec b/packaging/gst-plugins-base.spec index 3f0eb7f..36644a9 100644 --- a/packaging/gst-plugins-base.spec +++ b/packaging/gst-plugins-base.spec @@ -77,6 +77,7 @@ export V=1 NOCONFIGURE=1 ./autogen.sh export CFLAGS="%{optflags} -fno-strict-aliasing\ %ifarch %{arm} + -DGST_EXT_AUDIODECODER_MODIFICATION\ -DGST_EXT_XV_ENHANCEMENT\ -DGST_EXT_LINK_FIMCCONVERT\ -DGST_EXT_MIME_TYPES -- 2.7.4