From: <wt...@ke...> - 2010-09-07 14:52:28
|
Module: gst-plugins-good Branch: master Commit: 2b81f913a423afcea700f78c8ec0f8dbc77ca3f4 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=2b81f913a423afcea700f78c8ec0f8dbc77ca3f4 Author: Wim Taymans <wim...@co...> Date: Tue Sep 7 16:49:16 2010 +0200 jpegdec: avoid invalid adapter flush on QoS First store the available data in the adapter in the rem_img_len instance field before trying to flush the adapter with that value on QoS. --- ext/jpeg/gstjpegdec.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/jpeg/gstjpegdec.c b/ext/jpeg/gstjpegdec.c index 5f85ac8..207fe8b 100644 --- a/ext/jpeg/gstjpegdec.c +++ b/ext/jpeg/gstjpegdec.c @@ -1203,19 +1203,20 @@ gst_jpeg_dec_chain (GstPad * pad, GstBuffer * buf) goto need_more_data; } + dec->rem_img_len = img_len; + + GST_LOG_OBJECT (dec, "image size = %u", img_len); + /* QoS: if we're too late anyway, skip decoding */ if (dec->packetized && !gst_jpeg_dec_do_qos (dec, timestamp)) goto skip_decoding; - GST_LOG_OBJECT (dec, "image size = %u", img_len); - #ifndef GST_DISABLE_GST_DEBUG data = (guint8 *) gst_adapter_peek (dec->adapter, 4); GST_LOG_OBJECT (dec, "reading header %02x %02x %02x %02x", data[0], data[1], data[2], data[3]); #endif - dec->rem_img_len = img_len; gst_jpeg_dec_fill_input_buffer (&dec->cinfo); if (setjmp (dec->jerr.setjmp_buffer)) { |