From 2d28da1994b553ab853a73b80d1dd04289b5c32d Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 17 Sep 2009 16:54:57 -0700 Subject: [PATCH] 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 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ext/schroedinger/gstschrodec.c b/ext/schroedinger/gstschrodec.c index 1dcca7ac47..92848106b2 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; }