[vlc-commits] avformat: avoid EOF if av_read_frame returns AVERROR(EAGAIN)
Rui Zhang
git at videolan.org
Thu Jul 12 16:29:38 CEST 2012
vlc | branch: master | Rui Zhang <bbcallen at gmail.com> | Thu Jul 12 19:59:25 2012 +0800| [352ea7df94b18869277457c79e7d5c10f388f075] | committer: Jean-Baptiste Kempf
avformat: avoid EOF if av_read_frame returns AVERROR(EAGAIN)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=352ea7df94b18869277457c79e7d5c10f388f075
---
modules/demux/avformat/demux.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index cce867e..21a0bf7 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -591,8 +591,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 )
More information about the vlc-commits
mailing list