summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-30 03:32:56 +0200
committerwm4 <wm4@nowhere>2014-07-30 03:32:56 +0200
commit0dd52286265bcbfb7982690e6217eb9190651107 (patch)
tree0065851f9ed37f4aefc04db03856e16971b5a4b6 /demux
parent6856d81c6826e9698fe0154903f509d5a82917bb (diff)
downloadmpv-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.c5
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);