changeset 32754:08deb5816d9c

Fix r32824: It broke -frames and many, many other things. Change only the ->eof handling case that needs to be changed to fix the sample instead.
author reimar
date Wed, 02 Feb 2011 18:30:20 +0000
parents 9981c24b59bd
children f03a237a8d26
files mplayer.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Tue Feb 01 20:45:41 2011 +0000
+++ b/mplayer.c	Wed Feb 02 18:30:20 2011 +0000
@@ -3660,7 +3660,7 @@
 }
 #endif
 
-while(!mpctx->eof || (mpctx->sh_audio && !mpctx->d_audio->eof)){
+while(!mpctx->eof){
     float aq_sleep_time=0;
 
 if(dvd_last_chapter>0) {
@@ -3724,9 +3724,13 @@
 	  mp_msg(MSGT_CPLAYER,MSGL_FATAL, MSGTR_NotInitializeVOPorVO);
 	  mpctx->eof = 1; goto goto_next_file;
       }
-      if (frame_time < 0)
+      if (frame_time < 0) {
+          // if we have no more video, sleep some arbitrary time
+          frame_time = 1.0/20.0;
+          // only stop playing when audio is at end as well
+          if (!mpctx->sh_audio || mpctx->d_audio->eof)
 	  mpctx->eof = 1;
-      else {
+      } else {
 	  // might return with !eof && !blit_frame if !correct_pts
 	  mpctx->num_buffered_frames += blit_frame;
 	  mpctx->time_frame += frame_time / playback_speed;  // for nosound