diff options
author | wm4 <wm4@nowhere> | 2014-12-21 23:55:00 +0100 |
---|---|---|
committer | Alessandro Ghedini <alessandro@ghedini.me> | 2015-01-14 16:19:22 +0100 |
commit | 0cf7316c4751d0974952aeeba26d2bbe536b1f65 (patch) | |
tree | 0e00c8eaf973ca1b2da319abc3e63f7daa290806 | |
parent | 3a6572d206f211f4cbd6651f72fdf0ac7919ad13 (diff) | |
download | mpv-0cf7316c4751d0974952aeeba26d2bbe536b1f65.tar.bz2 mpv-0cf7316c4751d0974952aeeba26d2bbe536b1f65.tar.xz |
sd_lavc: compensate for a stupid libavcodec API issue
The libavcodec PGS decoder sets end_display_time to UINT32_MAX, in an
attempt to signal unknown end time (the API does not allow to signal
this properly, and this was a backwards compatible hack).
While we have no issues with the large value, our code wants to
distinguish between known and unknown end time explicitly.
-rw-r--r-- | sub/sd_lavc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index 5e0398d41c..3628607eed 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -210,8 +210,11 @@ static void decode(struct sd *sd, struct demux_packet *packet) return; if (pts != MP_NOPTS_VALUE) { - if (sub.end_display_time > sub.start_display_time) + if (sub.end_display_time > sub.start_display_time && + sub.end_display_time != UINT32_MAX) + { duration = (sub.end_display_time - sub.start_display_time) / 1000.0; + } pts += sub.start_display_time / 1000.0; } double endpts = MP_NOPTS_VALUE; |