changeset 32732:67e0128e2f1a

Update PAUSED status line with cache fill status if it changed.
author reimar
date Wed, 26 Jan 2011 21:51:43 +0000
parents 005b026b1231
children e922613845cc
files mplayer.c
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Wed Jan 26 21:48:15 2011 +0000
+++ b/mplayer.c	Wed Jan 26 21:51:43 2011 +0000
@@ -2475,6 +2475,9 @@
 static void pause_loop(void)
 {
     mp_cmd_t* cmd;
+#ifdef CONFIG_STREAM_CACHE
+    int old_cache_fill = stream_cache_size > 0 ? cache_fill_status(mpctx->stream) : 0;
+#endif
     if (!quiet) {
         if (term_osd && !mpctx->sh_video) {
             set_osd_msg(OSD_MSG_PAUSE, 1, 0, MSGTR_Paused);
@@ -2514,6 +2517,22 @@
         if (vf_menu)
             vf_menu_pause_update(vf_menu);
 #endif
+#ifdef CONFIG_STREAM_CACHE
+        if (!quiet && stream_cache_size > 0)
+        {
+            int new_cache_fill = cache_fill_status(mpctx->stream);
+            if (new_cache_fill != old_cache_fill) {
+                if (term_osd && !mpctx->sh_video) {
+                    set_osd_msg(OSD_MSG_PAUSE, 1, 0, MSGTR_Paused" %d%%",
+                                new_cache_fill);
+                    update_osd_msg();
+                } else
+                    mp_msg(MSGT_CPLAYER, MSGL_STATUS, MSGTR_Paused" %d%%\r",
+                           new_cache_fill);
+                old_cache_fill = new_cache_fill;
+            }
+        }
+#endif
         usec_sleep(20000);
     }
     if (cmd && cmd->id == MP_CMD_PAUSE) {