summaryrefslogtreecommitdiff
path: root/ext/mpeg2dec
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mpeg2dec')
-rw-r--r--ext/mpeg2dec/gstmpeg2dec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c
index 3ba28802..1c76cfa6 100644
--- a/ext/mpeg2dec/gstmpeg2dec.c
+++ b/ext/mpeg2dec/gstmpeg2dec.c
@@ -509,7 +509,9 @@ gst_mpeg2dec_crop_buffer (GstMpeg2dec * dec, GstVideoCodecFrame * in_frame,
if (!gst_video_frame_map (&output_frame, info, buffer, GST_MAP_WRITE))
goto map_fail;
- gst_buffer_replace (&in_frame->output_buffer, buffer);
+ if (in_frame->output_buffer)
+ gst_buffer_unref (in_frame->output_buffer);
+ in_frame->output_buffer = buffer;
if (!gst_video_frame_copy (&output_frame, input_vframe))
goto copy_failed;