[0.10] gst-plugins-bad: basevideocodec: Reset should reset current caps

Tim Müller tpm at kemper.freedesktop.org
Wed Jan 4 10:07:56 PST 2012

Module: gst-plugins-bad
Branch: 0.10
Commit: 7da86792f784231abf57f8f19df7edb74022dbdd
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=7da86792f784231abf57f8f19df7edb74022dbdd

Author: Thiago Santos <thiago.sousa.santos at collabora.com>
Date:   Fri Dec 30 00:02:46 2011 -0300

basevideocodec: Reset should reset current caps

New caps will need to be negotiated when reset happens
(PAUSED to READY). Without reseting the internal
stored format, basevideoencoder/decoder wouldn't call the
configuration function when the same caps was negotiated
again as they would believe this was the same caps as before.

The issue is that _stop has been called when going to READY and
the elements would have reset their internal codec libs/state as
well. A new configuration should be done.


 gst-libs/gst/video/gstbasevideocodec.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/gst-libs/gst/video/gstbasevideocodec.c b/gst-libs/gst/video/gstbasevideocodec.c
index 68e203d..ee162be 100644
--- a/gst-libs/gst/video/gstbasevideocodec.c
+++ b/gst-libs/gst/video/gstbasevideocodec.c
@@ -119,6 +119,8 @@ gst_base_video_codec_reset (GstBaseVideoCodec * base_video_codec)
   gst_buffer_replace (&base_video_codec->state.codec_data, NULL);
   gst_caps_replace (&base_video_codec->state.caps, NULL);
+  memset (&base_video_codec->state, 0, sizeof (GstVideoState));
+  base_video_codec->state.format = GST_VIDEO_FORMAT_UNKNOWN;

More information about the gstreamer-commits mailing list