[MPlayer-users] Show Bandwidth

Larry Reznick lreznick at idistream.com
Tue Jul 31 16:12:41 CEST 2007


Hello.

For some video work I'm doing, I need to see the bandwidth in the OSD 
while the video is running. I took the latest SVN, duplicated it in 
another directory, and made the following change:

--- mplayer/mplayer.c   2007-07-30 11:14:59.000000000 -0700
+++ idimplayer/mplayer.c        2007-07-30 13:16:27.000000000 -0700
@@ -1424,6 +1424,7 @@
             int percentage = -1;
             char percentage_text[10];
             int pts = demuxer_get_current_time(mpctx->demuxer);
+           static int last_pts;
            
             if (mpctx->osd_show_percentage)
                 percentage = demuxer_get_percent_pos(mpctx->demuxer);
@@ -1438,10 +1439,13 @@
                          "%c %02d:%02d:%02d / %02d:%02d:%02d%s",
                          mpctx->osd_function,pts/3600,(pts/60)%60,pts%60,
                          len/3600,(len/60)%60,len%60,percentage_text);
-            else
-                snprintf(osd_text_timer, 63, "%c %02d:%02d:%02d%s",
+            else if (pts != last_pts) {
+                snprintf(osd_text_timer, 63, "%c %02d:%02d:%02d%s kbps=%d",
                          mpctx->osd_function,pts/3600,(pts/60)%60,
-                         pts%60,percentage_text);
+                         pts%60,percentage_text,
+                        pts ? mpctx->stream->pos / pts / 125 : 0);
+               last_pts = pts;
+           }
         } else
             osd_text_timer[0]=0;
        
The modification to the snprintf() was sufficient, but I added the 
last_pts handling to smooth it out because this function gets called 
several times a second.

My question is which list do I submit it to for consideration to include 
it -- possibly triggered differently if this Q&D approach is not 
appropriate -- in the code? Is it the MPlayer-dev-eng list?

--Larry
**



More information about the MPlayer-users mailing list