[MPlayer-dev-eng] [PATCH] do not count decode-failed frames with -frames
Reimar =?UTF8?Q?D=F6ffinger?=
Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Jun 24 16:08:25 CEST 2005
Hi,
the attached patch makes supressed frames not count for -frames.
This is the case for both frames suppressed due to framedrop, but
more importantly to non-decodable frames (happens especially when
seeking with -ss and not ending up at an I-Frame).
Please commment, I will probably apply tomorrow otherwise.
Greetings,
Reimar D?ffinger
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.849
diff -u -r1.849 mplayer.c
--- mplayer.c 20 Jun 2005 23:07:34 -0000 1.849
+++ mplayer.c 24 Jun 2005 14:02:05 -0000
@@ -2238,11 +2238,6 @@
while(!eof){
float aq_sleep_time=0;
- if(play_n_frames>=0){
- --play_n_frames;
- if(play_n_frames<0) eof = PT_NEXT_ENTRY;
- }
-
/*========================== PLAY AUDIO ============================*/
while(sh_audio){
@@ -2519,6 +2514,11 @@
/* printf ("PANIC: too slow frame (%.3f)!\n", j); */
if(vo_config_count) video_out->flip_page();
+ if (play_n_frames >= 0) {
+ --play_n_frames;
+ if (play_n_frames < 0) eof = PT_NEXT_ENTRY;
+ }
+
// usec_sleep(50000); // test only!
t2=GetTimer()-t2;
tt = t2*0.000001f;
Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.288
diff -u -r1.288 mencoder.c
--- mencoder.c 1 Jun 2005 09:01:41 -0000 1.288
+++ mencoder.c 24 Jun 2005 14:02:05 -0000
@@ -1259,6 +1259,8 @@
if (sh_video->vf_inited < 0) mencoder_exit(1, NULL);
if(!blit_frame){
+ if (play_n_frames >= 0)
+ play_n_frames++;
badframes++;
if(skip_flag<=0){
// unwanted skipping of a frame, what to do?
More information about the MPlayer-dev-eng
mailing list