[vlc-commits] avformat: avoid EOF if av_read_frame returns AVERROR(EAGAIN)
Rui Zhang
git at videolan.org
Wed Jul 18 12:43:52 CEST 2012
vlc/vlc-2.0 | branch: master | Rui Zhang <bbcallen at gmail.com> | Thu Jul 12 19:59:25 2012 +0800| [fa21a4ab8d241233ae08c5c30898db629a81caee] | committer: Christoph Miebach
avformat: avoid EOF if av_read_frame returns AVERROR(EAGAIN)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 352ea7df94b18869277457c79e7d5c10f388f075)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
In fact, it closes #7145
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=fa21a4ab8d241233ae08c5c30898db629a81caee
---
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 3264b11..ada3849 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -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 )
More information about the vlc-commits
mailing list