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:
wm4 2012-11-19 00:28:38 +01:00
parent 9085b85729
commit 6f6dfc5163
1 changed files with 2 additions and 1 deletions

View File

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