From 1e3400e353d7aea5243f074f45741eb1cee9b1ad Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 21 Dec 2014 23:55:00 +0100 Subject: 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. --- sub/sd_lavc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sub/sd_lavc.c') 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; -- cgit v1.2.3