From 2d74b2d832659efc81090a2c6bd9808ffeba3bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= Date: Wed, 18 Sep 2019 21:29:25 +0300 Subject: sub/sd_ass: utilize UINT32_MAX subtitle duration for unknown US closed captions, teletext and ARIB caption decoders utilize this value. --- sub/sd_ass.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'sub/sd_ass.c') diff --git a/sub/sd_ass.c b/sub/sd_ass.c index d3eee38a45..bf2a49eb9e 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -234,17 +234,18 @@ static void decode(struct sd *sd, struct demux_packet *packet) if (!sd->opts->sub_clear_on_seek && packet->pos >= 0 && check_packet_seen(sd, packet->pos)) return; - if (packet->duration < 0) { + + double sub_pts = 0; + double sub_duration = 0; + char **r = lavc_conv_decode(ctx->converter, packet, &sub_pts, + &sub_duration); + if (packet->duration < 0 || sub_duration == UINT32_MAX) { if (!ctx->duration_unknown) { MP_WARN(sd, "Subtitle with unknown duration.\n"); ctx->duration_unknown = true; } - packet->duration = UNKNOWN_DURATION; + sub_duration = UNKNOWN_DURATION; } - double sub_pts = 0; - double sub_duration = 0; - char **r = lavc_conv_decode(ctx->converter, packet, &sub_pts, - &sub_duration); for (int n = 0; r && r[n]; n++) { char *ass_line = r[n]; -- cgit v1.2.3