From: <ds...@ke...> - 2009-09-18 00:38:46
|
Module: gst-plugins-bad Branch: master Commit: 2d28da1994b553ab853a73b80d1dd04289b5c32d URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=2d28da1994b553ab853a73b80d1dd04289b5c32d Author: David Schleef <ds...@sc...> Date: Thu Sep 17 16:54:57 2009 -0700 schrodec: Fix resync bug due to adapter API change gst_adapter_masked_scan_uint32() changed slightly from when this element was in Schroedinger. Oops. --- ext/schroedinger/gstschrodec.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ext/schroedinger/gstschrodec.c b/ext/schroedinger/gstschrodec.c index 1dcca7a..9284810 100644 --- a/ext/schroedinger/gstschrodec.c +++ b/ext/schroedinger/gstschrodec.c @@ -545,6 +545,7 @@ gst_schro_dec_scan_for_sync (GstBaseVideoDecoder * base_video_decoder, { GstAdapter *adapter = base_video_decoder->input_adapter; int n_available; + int ret; n_available = gst_adapter_available (adapter) - offset; @@ -556,10 +557,14 @@ gst_schro_dec_scan_for_sync (GstBaseVideoDecoder * base_video_decoder, } } - n_available -= 3; + n = MIN (n, n_available - 3); - return gst_adapter_masked_scan_uint32 (adapter, 0xffffffff, 0x42424344, - offset, MIN (n, n_available - 3)); + ret = gst_adapter_masked_scan_uint32 (adapter, 0xffffffff, 0x42424344, + offset, n); + if (ret == -1) { + return n; + } + return ret; } |