Commit 74632021 authored by Rui Zhang's avatar Rui Zhang Committed by Jean-Baptiste Kempf

avformat: avoid EOF if av_read_frame returns AVERROR(EAGAIN)

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 352ea7df)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>

In fact, it closes #7145
parent 14af0285
......@@ -571,8 +571,13 @@ static int Demux( demux_t *p_demux )
int64_t i_start_time;
/* Read a frame */
if( av_read_frame( p_sys->ic, &pkt ) )
int i_av_ret = av_read_frame( p_sys->ic, &pkt );
if( i_av_ret )
{
/* Avoid EOF if av_read_frame returns AVERROR(EAGAIN) */
if( i_av_ret == AVERROR(EAGAIN) )
return 1;
return 0;
}
if( pkt.stream_index < 0 || pkt.stream_index >= p_sys->i_tk )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment