From 986099d32356bb2c9520ae32b987e7155be55605 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 24 Jul 2014 15:26:07 +0200 Subject: audio: fix race condition in EOF code Don't return an EOF code if there's still buffered data. Also, don't call demux_stream_eof() in the playloop. There's probably nothing wrong with it, but it's cleaner not to use it. Also give AD_EOF its own value, so that a decoding error doesn't drain audio by causing an EOF condition. --- audio/decode/dec_audio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/decode/dec_audio.h') diff --git a/audio/decode/dec_audio.h b/audio/decode/dec_audio.h index c1b5eafb49..f9269b5272 100644 --- a/audio/decode/dec_audio.h +++ b/audio/decode/dec_audio.h @@ -51,9 +51,9 @@ struct dec_audio { enum { AD_OK = 0, AD_ERR = -1, - AD_EOF = -1, // same as AD_ERR for now AD_NEW_FMT = -2, AD_ASYNC_PLAY_DONE = -3, + AD_EOF = -4, }; struct mp_decoder_list *audio_decoder_list(void); -- cgit v1.2.3