[MPlayer-dev-eng] [PATCH] Display framedropping state in the OSD

Diego Biurrun diego at biurrun.de
Fri Feb 6 03:21:14 CET 2004


Hi!

After being (rightly) accused by Gabucino of fixing (only?) bugs that
nobody complains about I sulked for a day and decided to come up with
something useful.  The attached patch is the closest I could come,
whatever that may mean.

I noticed that the "d" key toggles frame dropping, but gives no visual
feedback on the OSD, unlike similar keys that toggle, e.g. subtitle
visibility and similar stuff.  The attached patch fixes this and
displays

  Framedropping: [on|hard|off]

on the OSD depending on whether framedrop, hardframedrop or no
framedrop is currently enabled.

I'm not sure if [on|hard|off] is the best possible wording, maybe
something to the effect of [skip displaying|skip decoding|none] is
better.  I'm open to suggestions here.

So somebody please check and tell me if it's OK to apply.

Diego

--- mplayer.c	29 Jan 2004 12:01:25 -0000	1.745
+++ mplayer.c	6 Feb 2004 02:13:52 -0000
@@ -736,6 +736,7 @@
 int osd_show_percentage = 0;
 int osd_show_tv_channel = 25;
 int osd_show_ontop = 0;
+int osd_show_framedropping = 0;
 
 int rtc_fd=-1;
 
@@ -2854,8 +2855,13 @@
     } break;
     case MP_CMD_FRAMEDROPPING :  {
       int v = cmd->args[0].v.i;
-      if(v < 0)
+      if(v < 0){
 	frame_dropping = (frame_dropping+1)%3;
+#ifdef USE_OSD
+       osd_show_framedropping=10;
+       vo_osd_changed(OSDTYPE_SUBTITLE);
+#endif
+      }
       else
 	frame_dropping = v > 2 ? 2 : v;
     } break;
@@ -3559,6 +3565,11 @@
       } else if (osd_show_ontop) {
 	  snprintf(osd_text_tmp, 63, "Stay on top: %sabled", vo_ontop?"en":"dis");
 	  osd_show_ontop--;
+      } else if (osd_show_framedropping) {
+	  snprintf(osd_text_tmp, 63, "Framedropping: %s",
+	     (frame_dropping == 1 ? "on" :
+	     (frame_dropping == 2 ? "hard"  : "off")));
+	  osd_show_framedropping--;
       } else if(osd_level>=2) {
           int len = demuxer_get_time_length(demuxer);
           int percentage = -1;




More information about the MPlayer-dev-eng mailing list