diff options
Diffstat (limited to 'sub/sd_lavc.c')
-rw-r--r-- | sub/sd_lavc.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index 43dbfeee00..30aa641437 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -300,17 +300,8 @@ static void decode(struct sd *sd, struct demux_packet *packet) AVCodecContext *ctx = priv->avctx; double pts = packet->pts; double endpts = MP_NOPTS_VALUE; - double duration = packet->duration; AVSubtitle sub; - // 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) - duration = -1; - if (pts == MP_NOPTS_VALUE) MP_WARN(sd, "Subtitle with unknown start time.\n"); @@ -334,13 +325,10 @@ static void decode(struct sd *sd, struct demux_packet *packet) 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; + endpts = pts + sub.end_display_time / 1000.0; } pts += sub.start_display_time / 1000.0; - if (duration >= 0) - endpts = pts + duration; - // set end time of previous sub struct sub *prev = &priv->subs[0]; if (prev->valid) { |