diff options
author | wm4 <wm4@nowhere> | 2016-09-26 17:55:00 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-26 17:55:00 +0200 |
commit | dd339b200be99ecac1a0bb4a7509b338120c5bce (patch) | |
tree | 601e50767159ddc73118fabfa6ec5b42d0406c64 /player | |
parent | e6dedbcc230f6382875bbb5f78a918dc204e8baa (diff) | |
download | mpv-dd339b200be99ecac1a0bb4a7509b338120c5bce.tar.bz2 mpv-dd339b200be99ecac1a0bb4a7509b338120c5bce.tar.xz |
video: trust demuxer framerate on invalid timestamps
If the PTS goes backwards (whether it's a timestamp reset or some other
problem) would just use 0 as frame duration. (At least until the logic
for detecting divergence with the timestamps gets active.)
Trust the demuxer framerate in these cases instead, if it's available. I
think this improves behavior slightly with some broken files.
Diffstat (limited to 'player')
-rw-r--r-- | player/video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c index ca207fb6aa..69128025b7 100644 --- a/player/video.c +++ b/player/video.c @@ -1288,7 +1288,7 @@ static void calculate_frame_duration(struct MPContext *mpctx) double demux_duration = mpctx->vo_chain->container_fps > 0 ? 1.0 / mpctx->vo_chain->container_fps : -1; - double duration = -1; + double duration = demux_duration; if (mpctx->num_next_frames >= 2) { double pts0 = mpctx->next_frames[0]->pts; |