mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
vaapivideomemory: increment map counter only if succeeded
Previously the frame map counter increased independently if the map succeeded or not. This leaded to critical messages and crashes if the frame was unable to be mapped, but the counter increased. This patch increases the map counter only if the map operation occurred. https://bugzilla.gnome.org/show_bug.cgi?id=773939
This commit is contained in:
parent
1f190e49c4
commit
ae8e5d44f7
1 changed files with 2 additions and 1 deletions
|
@ -239,7 +239,7 @@ gst_video_meta_map_vaapi_memory (GstVideoMeta * meta, guint plane,
|
|||
goto error_incompatible_map;
|
||||
|
||||
/* Map for writing */
|
||||
if (++mem->map_count == 1) {
|
||||
if (mem->map_count == 0) {
|
||||
if (!ensure_surface (mem))
|
||||
goto error_ensure_surface;
|
||||
if (!ensure_image (mem))
|
||||
|
@ -258,6 +258,7 @@ gst_video_meta_map_vaapi_memory (GstVideoMeta * meta, guint plane,
|
|||
GST_VAAPI_VIDEO_MEMORY_FLAG_UNSET (mem,
|
||||
GST_VAAPI_VIDEO_MEMORY_FLAG_SURFACE_IS_CURRENT);
|
||||
}
|
||||
mem->map_count++;
|
||||
|
||||
*data = gst_vaapi_image_get_plane (mem->image, plane);
|
||||
*stride = gst_vaapi_image_get_pitch (mem->image, plane);
|
||||
|
|
Loading…
Reference in a new issue