summaryrefslogtreecommitdiffstats
path: root/sub/sd_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-24 12:26:34 +0200
committerwm4 <wm4@nowhere>2014-08-24 12:26:34 +0200
commit2c114db2f15a19a77ba00a9d7c785359fcb9bfd3 (patch)
treeacac91942eff8914107f8efb88073bcd52c07df8 /sub/sd_lavc.c
parent1cedb323ad0819690306b78d206e383d986d830e (diff)
downloadmpv-2c114db2f15a19a77ba00a9d7c785359fcb9bfd3.tar.bz2
mpv-2c114db2f15a19a77ba00a9d7c785359fcb9bfd3.tar.xz
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.
Diffstat (limited to 'sub/sd_lavc.c')
-rw-r--r--sub/sd_lavc.c5
1 files changed, 1 insertions, 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)