diff options
author | wm4 <wm4@nowhere> | 2016-08-04 11:26:57 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-08-04 11:26:57 +0200 |
commit | 3c3361217c96337270b112e52f9eb6cc5931b390 (patch) | |
tree | b1133f42294800b4da44730c6869db2ec589f80f /player/core.h | |
parent | 356e703510170151a1678e9b1deab2ffdd5c92fb (diff) | |
download | mpv-3c3361217c96337270b112e52f9eb6cc5931b390.tar.bz2 mpv-3c3361217c96337270b112e52f9eb6cc5931b390.tar.xz |
player: offset demuxer on start/seek properly with audio/sub delay
Assume you use a large value like --audio-delay=20. Then until now the
player would just have seeked normally to a "too late" position, and
played silence for about 20 seconds until audio in the correct time
range is coming again.
Change this by offsetting seeks by the right amount. This works for both
external and muxed files. If a seek isn't precise, then it works only
for external files.
This might cause issues with very large delay options. Hr-seek skipping
could take a lot of time (especially because it affects video too), the
demuxer queue could overflow, and other weird corner cases could appear.
But we just try this on best-effort basis, and if the user uses extreme
values we don't guarantee good behavior.
Diffstat (limited to 'player/core.h')
-rw-r--r-- | player/core.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/player/core.h b/player/core.h index f2a9f191fa..1dc6da7331 100644 --- a/player/core.h +++ b/player/core.h @@ -486,6 +486,7 @@ int stream_dump(struct MPContext *mpctx, const char *source_filename); int mpctx_run_reentrant(struct MPContext *mpctx, void (*thread_fn)(void *arg), void *thread_arg); struct mpv_global *create_sub_global(struct MPContext *mpctx); +double get_track_seek_offset(struct MPContext *mpctx, struct track *track); // osd.c void set_osd_bar(struct MPContext *mpctx, int type, |