diff options
author | wm4 <wm4@nowhere> | 2014-07-30 03:32:56 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-07-30 03:32:56 +0200 |
commit | 0dd52286265bcbfb7982690e6217eb9190651107 (patch) | |
tree | 0065851f9ed37f4aefc04db03856e16971b5a4b6 /demux | |
parent | 6856d81c6826e9698fe0154903f509d5a82917bb (diff) | |
download | mpv-0dd52286265bcbfb7982690e6217eb9190651107.tar.bz2 mpv-0dd52286265bcbfb7982690e6217eb9190651107.tar.xz |
demux_lavf: don't consider EAGAIN as EOF condition
This happens apparently randomly with rtmp:// and after seeks. This
eventually leads to audio decoding returning an EOF status, which
basically disables audio sync. This will lead to audio desync, even if
audio decoding later "recovers" when the demuxer actually returns audio
packets.
Hack-fix this by special-casing EAGAIN.
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux_lavf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 41263ceabf..3ccda55d8e 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -780,9 +780,10 @@ static int demux_lavf_fill_buffer(demuxer_t *demux) demux_packet_t *dp; AVPacket *pkt = talloc(NULL, AVPacket); - if (av_read_frame(priv->avfc, pkt) < 0) { + int r = av_read_frame(priv->avfc, pkt); + if (r < 0) { talloc_free(pkt); - return 0; // eof + return r == AVERROR(EAGAIN) ? 1 : -1; // eof } talloc_set_destructor(pkt, destroy_avpacket); |