From eb740673b8a110f5d18879ba0080e9d3f13387d0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 2 Apr 2016 17:35:42 +0200 Subject: sd_lavc: add a comment about duration==0 handling Basically, this information is useless, because some muxers (hurr libavformat) write bogus information anyway. This means if we e.g. see PGS packets in mkv with duration explicitly set to 0, we must not trust that value anyway. (The FFmpeg API problem is leaking into files, how nice.) --- sub/sd_lavc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sub') diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index 74d19f8369..f0c51ceaa6 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -166,7 +166,9 @@ static void decode(struct sd *sd, struct demux_packet *packet) AVSubtitle sub; AVPacket pkt; - // libavformat sets duration==0, even if the duration is unknown. + // libavformat sets duration==0, even if the duration is unknown. Some files + // also have actually subtitle packets with duration explicitly set to 0 + // (yes, at least some of such mkv files were muxed by libavformat). // Assume there are no bitmap subs that actually use duration==0 for // hidden subtitle events. if (duration == 0) -- cgit v1.2.3