diff --git a/ChangeLog b/ChangeLog index d3ef3d99a0..dbcef9a101 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-07-10 Wim Taymans + + * ext/mpeg2dec/gstmpeg2dec.c: (crop_buffer), (handle_slice): + Fix refcounting when cropping. Fixes #341677. + 2006-07-09 Wim Taymans Patch by: Grzegorz Lukasik diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c index 15c56b5826..7b6bd362f0 100644 --- a/ext/mpeg2dec/gstmpeg2dec.c +++ b/ext/mpeg2dec/gstmpeg2dec.c @@ -428,6 +428,7 @@ crop_buffer (GstMpeg2dec * mpeg2dec, GstBuffer ** buf) gst_buffer_set_caps (outbuf, GST_PAD_CAPS (mpeg2dec->srcpad)); gst_buffer_stamp (outbuf, input); + gst_buffer_unref (input); *buf = outbuf; result = TRUE; @@ -851,14 +852,13 @@ handle_slice (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info) GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)), GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf))); - if ((mpeg2dec->decoded_height > mpeg2dec->height) || - (mpeg2dec->decoded_width > mpeg2dec->width)) { - crop_buffer (mpeg2dec, &outbuf); - } - /* ref before pushing it out, so we still have the ref in our * array of buffers */ gst_buffer_ref (outbuf); + + /* do cropping if needed */ + crop_buffer (mpeg2dec, &outbuf); + ret = gst_pad_push (mpeg2dec->srcpad, outbuf); GST_DEBUG_OBJECT (mpeg2dec, "pushed with result %s", gst_flow_get_name (ret));