summaryrefslogtreecommitdiffstats
path: root/core/mplayer.c
diff options
context:
space:
mode:
authorRudolf Polzer <divverent@xonotic.org>2013-06-20 11:16:51 +0200
committerRudolf Polzer <divverent@xonotic.org>2013-06-20 11:17:13 +0200
commit011f54c68bd2d386e45f27c860c0a878d9ff5f1b (patch)
treef329955003d4fbf1e0d2f3df4a8d062b8b22a813 /core/mplayer.c
parent9137d86eda325538bc7cc46fb275e8b823fbcb0f (diff)
downloadmpv-011f54c68bd2d386e45f27c860c0a878d9ff5f1b.tar.bz2
mpv-011f54c68bd2d386e45f27c860c0a878d9ff5f1b.tar.xz
encode_lavc: simplify encoding status output; remove percentage
Diffstat (limited to 'core/mplayer.c')
-rw-r--r--core/mplayer.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index 86260a0598..1a99c03644 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -1229,19 +1229,11 @@ static void print_status(struct MPContext *mpctx)
}
#ifdef CONFIG_ENCODING
- double startpos = rel_time_to_abs(mpctx, opts->play_start, 0);
- double endpos = rel_time_to_abs(mpctx, opts->play_end, -1);
- float position = (get_current_time(mpctx) - startpos) /
- (get_time_length(mpctx) - startpos);
- if (endpos != -1)
- position = max(position, (get_current_time(mpctx) - startpos)
- / (endpos - startpos));
- if (opts->play_frames > 0)
- position = max(position,
- 1.0 - mpctx->max_frames / (double) opts->play_frames);
+ double position = get_current_pos_ratio(mpctx);
+ // TODO rescale this to take --start, --end, --length, --frames into account
char lavcbuf[80];
if (encode_lavc_getstatus(mpctx->encode_lavc_ctx, lavcbuf, sizeof(lavcbuf),
- position, get_current_time(mpctx) - startpos) >= 0)
+ position) >= 0)
{
// encoding stats
saddf(&line, " %s", lavcbuf);