From 2c114db2f15a19a77ba00a9d7c785359fcb9bfd3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 24 Aug 2014 12:26:34 +0200 Subject: sd_lavc: remove ineffective code It makes no sense to set the packet duration, because libavcodec doesn't know the timebase. And in fact, no subtitle decoder accesses the packet duration, except text subtitle converters, which are not relevant here. So this code did nothing - drop it. Also fix a blatantly incorrect comment. --- sub/sd_lavc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index 72a6915287..206571e30b 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -47,7 +47,7 @@ struct sub { struct sd_lavc_priv { AVCodecContext *avctx; - struct sub subs[MAX_QUEUE]; // lowest pts first + struct sub subs[MAX_QUEUE]; // most recent event first struct sub_bitmap *outbitmaps; int64_t displayed_id; int64_t new_id; @@ -204,9 +204,6 @@ static void decode(struct sd *sd, struct demux_packet *packet) av_init_packet(&pkt); pkt.data = packet->buffer; pkt.size = packet->len; - pkt.pts = AV_NOPTS_VALUE; - if (duration >= 0) - pkt.convergence_duration = duration * 1000; int got_sub; int res = avcodec_decode_subtitle2(ctx, &sub, &got_sub, &pkt); if (res < 0 || !got_sub) -- cgit v1.2.3