0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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.
This commit is contained in:
wm4 2014-07-30 03:32:56 +02:00
parent 6856d81c68
commit 0dd5228626

View File

@ -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);