mirror of https://github.com/mpv-player/mpv
mplayer: fix potential issue when ao_play() fails
ao_play() can fail; in that case a negative error code is returned. This error code is returned by write_to_ao() in turn. The function fill_audio_out_buffers(), which calls write_to_ao(), doesn't check for any error codes, and will likely trigger the assertion following the function call. Change write_to_ao() to return 0 on failure to hopefully prevent crashes when AOs fail.
This commit is contained in:
parent
9085b85729
commit
6f6dfc5163
|
@ -2076,8 +2076,9 @@ static int write_to_ao(struct MPContext *mpctx, void *data, int len, int flags,
|
|||
// Keep correct pts for remaining data - could be used to flush
|
||||
// remaining buffer when closing ao.
|
||||
ao->pts += played / bps;
|
||||
return played;
|
||||
}
|
||||
return played;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define ASYNC_PLAY_DONE -3
|
||||
|
|
Loading…
Reference in New Issue