mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-15 22:01:27 +00:00
ffmpeg: avoid assertion failure on duplicate frame allocation
This commit is contained in:
parent
1638344081
commit
0489f5eb78
1 changed files with 8 additions and 0 deletions
|
@ -564,6 +564,9 @@ gst_ffmpegviddec_get_buffer (AVCodecContext * context, AVFrame * picture)
|
||||||
if (G_UNLIKELY (frame == NULL))
|
if (G_UNLIKELY (frame == NULL))
|
||||||
goto no_frame;
|
goto no_frame;
|
||||||
|
|
||||||
|
if (G_UNLIKELY (frame->output_buffer != NULL))
|
||||||
|
goto duplicate_frame;
|
||||||
|
|
||||||
/* GstFFMpegVidDecVideoFrame receives the frame ref */
|
/* GstFFMpegVidDecVideoFrame receives the frame ref */
|
||||||
picture->opaque = dframe = gst_ffmpegviddec_video_frame_new (frame);
|
picture->opaque = dframe = gst_ffmpegviddec_video_frame_new (frame);
|
||||||
|
|
||||||
|
@ -641,6 +644,11 @@ fallback:
|
||||||
{
|
{
|
||||||
return avcodec_default_get_buffer (context, picture);
|
return avcodec_default_get_buffer (context, picture);
|
||||||
}
|
}
|
||||||
|
duplicate_frame:
|
||||||
|
{
|
||||||
|
GST_WARNING_OBJECT (ffmpegdec, "already alloc'ed output buffer for frame");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
no_frame:
|
no_frame:
|
||||||
GST_WARNING_OBJECT (ffmpegdec, "Couldn't get codec frame !");
|
GST_WARNING_OBJECT (ffmpegdec, "Couldn't get codec frame !");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue