mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
ensure that audio-only files are decoded till the end by not only
waiting for eof but also checking that the a_in_buffer is empty. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16291 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
5e220d0356
commit
33cb784664
11
mplayer.c
11
mplayer.c
@ -2286,10 +2286,15 @@ while(sh_audio){
|
||||
// Fill buffer if needed:
|
||||
current_module="decode_audio"; // Enter AUDIO decoder module
|
||||
t=GetTimer();
|
||||
while(sh_audio->a_out_buffer_len<playsize && !d_audio->eof){
|
||||
while(sh_audio->a_out_buffer_len<playsize &&
|
||||
(!d_audio->eof || sh_audio->a_in_buffer_len > 0)){
|
||||
int ret=decode_audio(sh_audio,&sh_audio->a_out_buffer[sh_audio->a_out_buffer_len],
|
||||
playsize-sh_audio->a_out_buffer_len,sh_audio->a_out_buffer_size-sh_audio->a_out_buffer_len);
|
||||
if(ret<=0) break; // EOF?
|
||||
if(ret<=0) { // EOF?
|
||||
if (d_audio->eof)
|
||||
sh_audio->a_in_buffer_len = 0; // make sure we don't hang if something's broken
|
||||
break;
|
||||
}
|
||||
sh_audio->a_out_buffer_len+=ret;
|
||||
}
|
||||
t=GetTimer()-t;
|
||||
@ -2316,7 +2321,7 @@ if(!sh_video) {
|
||||
float a_pos = sh_audio->delay - audio_out->get_delay() * playback_speed;
|
||||
print_status(a_pos, 0, 0);
|
||||
}
|
||||
if(d_audio->eof) eof = PT_NEXT_ENTRY;
|
||||
if(d_audio->eof && sh_audio->a_in_buffer_len <= 0) eof = PT_NEXT_ENTRY;
|
||||
|
||||
} else {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user