From c109ce8fc936851408b47f8ce70fd0d740429f13 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 2 Nov 2012 11:58:30 +0100 Subject: [PATCH] Fixes for vp8dec including GNOME #687376 --- ...cuit-gst_vp8_dec_handle_frame-if-key.patch | 40 +++++++++++++++++++ ...ly-return-if-opening-the-decoder-fai.patch | 26 ++++++++++++ gstreamer1-plugins-good.spec | 9 ++++- 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 0001-vp8dec-Short-circuit-gst_vp8_dec_handle_frame-if-key.patch create mode 100644 0002-vp8dec-Immediately-return-if-opening-the-decoder-fai.patch diff --git a/0001-vp8dec-Short-circuit-gst_vp8_dec_handle_frame-if-key.patch b/0001-vp8dec-Short-circuit-gst_vp8_dec_handle_frame-if-key.patch new file mode 100644 index 0000000..4718a0f --- /dev/null +++ b/0001-vp8dec-Short-circuit-gst_vp8_dec_handle_frame-if-key.patch @@ -0,0 +1,40 @@ +From 3c216600f55351549573cf94be541fc6055db128 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 1 Nov 2012 22:02:39 +0100 +Subject: [PATCH 1/2] vp8dec: Short circuit gst_vp8_dec_handle_frame if + keyframe is missing + +https://bugzilla.gnome.org/show_bug.cgi?id=687376 +--- + ext/vpx/gstvp8dec.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/ext/vpx/gstvp8dec.c b/ext/vpx/gstvp8dec.c +index 9ec1771..7dcd75b 100644 +--- a/ext/vpx/gstvp8dec.c ++++ b/ext/vpx/gstvp8dec.c +@@ -415,7 +415,7 @@ open_codec (GstVP8Dec * dec, GstVideoCodecFrame * frame) + if (status != VPX_CODEC_OK || !stream_info.is_kf) { + GST_WARNING_OBJECT (dec, "No keyframe, skipping"); + gst_video_decoder_finish_frame (GST_VIDEO_DECODER (dec), frame); +- return GST_FLOW_OK; ++ return GST_FLOW_CUSTOM_SUCCESS_1; + } + + g_assert (dec->output_state == NULL); +@@ -483,8 +483,11 @@ gst_vp8_dec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame) + + dec = GST_VP8_DEC (decoder); + +- if (!dec->decoder_inited) ++ if (!dec->decoder_inited) { + ret = open_codec (dec, frame); ++ if (ret == GST_FLOW_CUSTOM_SUCCESS_1) ++ return GST_FLOW_OK; ++ } + + deadline = gst_video_decoder_get_max_decode_time (decoder, frame); + if (deadline < 0) { +-- +1.7.12.1 + diff --git a/0002-vp8dec-Immediately-return-if-opening-the-decoder-fai.patch b/0002-vp8dec-Immediately-return-if-opening-the-decoder-fai.patch new file mode 100644 index 0000000..dd116f1 --- /dev/null +++ b/0002-vp8dec-Immediately-return-if-opening-the-decoder-fai.patch @@ -0,0 +1,26 @@ +From f0640f205cca974ccbe0550e76ab37f16b7c8821 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= +Date: Fri, 2 Nov 2012 09:34:25 +0100 +Subject: [PATCH 2/2] vp8dec: Immediately return if opening the decoder failed + +Instead of ignoring any errors. +--- + ext/vpx/gstvp8dec.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/ext/vpx/gstvp8dec.c b/ext/vpx/gstvp8dec.c +index 7dcd75b..b5b4aa3 100644 +--- a/ext/vpx/gstvp8dec.c ++++ b/ext/vpx/gstvp8dec.c +@@ -487,6 +487,8 @@ gst_vp8_dec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame) + ret = open_codec (dec, frame); + if (ret == GST_FLOW_CUSTOM_SUCCESS_1) + return GST_FLOW_OK; ++ else if (ret != GST_FLOW_OK) ++ return ret; + } + + deadline = gst_video_decoder_get_max_decode_time (decoder, frame); +-- +1.7.12.1 + diff --git a/gstreamer1-plugins-good.spec b/gstreamer1-plugins-good.spec index 106fcff..3f23ece 100644 --- a/gstreamer1-plugins-good.spec +++ b/gstreamer1-plugins-good.spec @@ -9,12 +9,14 @@ Name: gstreamer1-plugins-good Version: 1.0.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: GStreamer plugins with good code and licensing License: LGPLv2+ URL: http://gstreamer.freedesktop.org/ Source0: http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-%{version}.tar.xz +Patch0: 0001-vp8dec-Short-circuit-gst_vp8_dec_handle_frame-if-key.patch +Patch1: 0002-vp8dec-Immediately-return-if-opening-the-decoder-fai.patch BuildRequires: gstreamer1-devel >= %{version} BuildRequires: gstreamer1-plugins-base-devel >= %{version} @@ -83,6 +85,8 @@ to be installed. %prep %setup -q -n gst-plugins-good-%{version} +%patch0 -p1 +%patch1 -p1 %build @@ -199,6 +203,9 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' %changelog +* Fri Nov 2 2012 Debarshi Ray - 1.0.2-2 +- Fixes for vp8dec including GNOME #687376 + * Thu Oct 25 2012 Brian Pepple - 1.0.2-1 - Update to 1.0.2 - Drop upstream patches since they are included in latest release.