mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
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:
parent
32a15afb81
commit
ddd13808b3
1 changed files with 2 additions and 0 deletions
|
@ -956,6 +956,7 @@ gst_mpeg2dec_handle_frame (GstVideoDecoder * decoder,
|
||||||
frame->system_frame_number,
|
frame->system_frame_number,
|
||||||
GST_TIME_ARGS (frame->pts), GST_TIME_ARGS (frame->duration));
|
GST_TIME_ARGS (frame->pts), GST_TIME_ARGS (frame->duration));
|
||||||
|
|
||||||
|
gst_buffer_ref (buf);
|
||||||
if (!gst_buffer_map (buf, &minfo, GST_MAP_READ)) {
|
if (!gst_buffer_map (buf, &minfo, GST_MAP_READ)) {
|
||||||
GST_ERROR_OBJECT (mpeg2dec, "Failed to map input buffer");
|
GST_ERROR_OBJECT (mpeg2dec, "Failed to map input buffer");
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
|
@ -1055,6 +1056,7 @@ gst_mpeg2dec_handle_frame (GstVideoDecoder * decoder,
|
||||||
|
|
||||||
done:
|
done:
|
||||||
gst_buffer_unmap (buf, &minfo);
|
gst_buffer_unmap (buf, &minfo);
|
||||||
|
gst_buffer_unref (buf);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue