mpeg2dec: Hold ref to buffer while mapped

So that the buffer still exists when we go to unmap it later,
even if it got pushed in the meantime.
This commit is contained in:
Jan Schmidt 2012-09-10 22:30:18 -07:00
parent 32a15afb81
commit ddd13808b3

View file

@ -956,6 +956,7 @@ gst_mpeg2dec_handle_frame (GstVideoDecoder * decoder,
frame->system_frame_number,
GST_TIME_ARGS (frame->pts), GST_TIME_ARGS (frame->duration));
gst_buffer_ref (buf);
if (!gst_buffer_map (buf, &minfo, GST_MAP_READ)) {
GST_ERROR_OBJECT (mpeg2dec, "Failed to map input buffer");
return GST_FLOW_ERROR;
@ -1055,6 +1056,7 @@ gst_mpeg2dec_handle_frame (GstVideoDecoder * decoder,
done:
gst_buffer_unmap (buf, &minfo);
gst_buffer_unref (buf);
return ret;
}