mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 17:50:10 +00:00
ffmpeg: Fix crash on some media files
Return code EAGAIN expects the user to feed more packets into the decoder
This commit is contained in:
parent
b0766a62ec
commit
1c8bddf3ca
@ -292,9 +292,15 @@ gtk_ff_media_file_decode_frame (GtkFfMediaFile *video,
|
||||
if (errnum >= 0)
|
||||
{
|
||||
errnum = avcodec_receive_frame (video->codec_ctx, frame);
|
||||
if (errnum == AVERROR (EAGAIN))
|
||||
{
|
||||
// Just retry with the next packet
|
||||
errnum = 0;
|
||||
continue;
|
||||
}
|
||||
if (errnum < 0)
|
||||
G_BREAKPOINT();
|
||||
if (errnum >= 0)
|
||||
else
|
||||
{
|
||||
av_packet_unref (&packet);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user