summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-01 00:39:49 +0200
committerwm4 <wm4@nowhere>2012-08-01 00:42:06 +0200
commit423a75250f4fa66abf8be7b48586e2e5fc1212e9 (patch)
tree99198759f905e587362654e63a02a1bbb50a9674 /command.c
parentf752212c6235316e681fade76c5693d46df7d310 (diff)
downloadmpv-423a75250f4fa66abf8be7b48586e2e5fc1212e9.tar.bz2
mpv-423a75250f4fa66abf8be7b48586e2e5fc1212e9.tar.xz
mplayer: make display of playback status more uniform
The code to format the playback time was duplicated a few times. There were also minor differences in how the time is formatted. Remove most of these differences. This also fixes a bug in the output of the osd_show_progression command, introduced in 74e7a1e937c10d9f4. There was some logic to display the percent position in the OSD status for a short while after seeking. Remove that logic and always display the percent position. Make --osd-fractions a flag option. This removes the ability to show the number of frames played since the start of the current second (i.e. the fraction of the time was turned into a frame number). This features wasn't so great anyway, because modern video file formats don't always have a (valid) FPS set, and could lead to inaccurate display. Still to sort out: Unfortunately, the terminal status is still formatted differently from the OSD, and even worse, it has a completely different time source. Not sure if I like how the status line looks now (it's a bit "full"?). Maybe it will be changed again later.
Diffstat (limited to 'command.c')
-rw-r--r--command.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/command.c b/command.c
index 72f978d3be..13a205dd63 100644
--- a/command.c
+++ b/command.c
@@ -3201,16 +3201,9 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
mpctx->stop_play = PT_STOP;
break;
- case MP_CMD_OSD_SHOW_PROGRESSION: {
- int len = get_time_length(mpctx);
- int pts = get_current_time(mpctx);
- set_osd_bar(mpctx, 0, "Position", 0, 100, get_percent_pos(mpctx));
- set_osd_msg(OSD_MSG_TEXT, 1, osd_duration,
- "%c %02d:%02d:%02d / %02d:%02d:%02d",
- mpctx->osd_function, pts / 3600, (pts / 60) % 60, pts % 60,
- len / 3600, (len / 60) % 60, len % 60);
+ case MP_CMD_OSD_SHOW_PROGRESSION:
+ mp_show_osd_progression(mpctx);
break;
- }
#ifdef CONFIG_RADIO
case MP_CMD_RADIO_STEP_CHANNEL: