changeset 1546:d4cd08b06665

display number of decoded frames (for progr. mpeg2)
author arpi
date Thu, 16 Aug 2001 01:03:51 +0000
parents da26060c81ef
children 4b0046db8e64
files demux_avi.c mplayer.c stheader.h
diffstat 3 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/demux_avi.c	Thu Aug 16 00:50:02 2001 +0000
+++ b/demux_avi.c	Thu Aug 16 01:03:51 2001 +0000
@@ -519,7 +519,7 @@
           int id=((AVIINDEXENTRY *)priv->idx)[i].ckid;
           if(avi_stream_id(id)==d_video->id) ++d_video->pack_no;
       }
-      sh_video->num_frames=d_video->pack_no;
+      sh_video->num_frames=sh_video->num_frames_decoded=d_video->pack_no;
       priv->avi_video_pts=d_video->pack_no*(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
       d_video->pos=video_chunk_pos;
       
--- a/mplayer.c	Thu Aug 16 00:50:02 2001 +0000
+++ b/mplayer.c	Thu Aug 16 01:03:51 2001 +0000
@@ -1223,6 +1223,7 @@
 
     // Increase video timers:
     sh_video->num_frames+=frame_time;
+    ++sh_video->num_frames_decoded;
     frame_time*=sh_video->frametime;
     if(file_format==DEMUXER_TYPE_ASF && !force_fps){
         // .ASF files has no fixed FPS - just frame durations!
@@ -1377,9 +1378,9 @@
         else
           max_pts_correction=sh_video->frametime*0.10; // +-10% of time
         sh_audio->timer+=x; c_total+=x;
-        if(!quiet) printf("A:%6.1f V:%6.1f  A-V:%7.3f ct:%7.3f  %3d  %2d%% %2d%% %4.1f%% %d %d\r",
+        if(!quiet) printf("A:%6.1f V:%6.1f A-V:%7.3f ct:%7.3f  %3d/%3d  %2d%% %2d%% %4.1f%% %d %d\r",
 	  a_pts-audio_delay-delay,v_pts,AV_delay,c_total,
-          (int)sh_video->num_frames,
+          (int)sh_video->num_frames,(int)sh_video->num_frames_decoded,
           (sh_video->timer>0.5)?(int)(100.0*video_time_usage/(double)sh_video->timer):0,
           (sh_video->timer>0.5)?(int)(100.0*vout_time_usage/(double)sh_video->timer):0,
           (sh_video->timer>0.5)?(100.0*audio_time_usage/(double)sh_video->timer):0
--- a/stheader.h	Thu Aug 16 00:50:02 2001 +0000
+++ b/stheader.h	Thu Aug 16 01:03:51 2001 +0000
@@ -56,6 +56,7 @@
 //  unsigned int bitrate;
   // buffers:
   float num_frames;       // number of frames played
+  int num_frames_decoded;       // number of frames decoded
   char *our_out_buffer;
   // win32 codec stuff:
   AVIStreamHeader video;