From 9f72a9753e68c4064796f2361fb12492a85a8e0b Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 25 Nov 2013 23:13:01 +0100 Subject: demux: export dts from demux_lavf, use it for avi Having the DTS directly can be useful for restoring PTS values. The avi file format doesn't actually store PTS values, just DTS. An older hack explicitly exported the DTS as PTS (ignoring the [I assume] genpts generated non-sense PTS), which is not necessary anymore due to this change. --- video/decode/vd_lavc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 03d77e1c2b..c13ef68aad 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -746,9 +746,6 @@ static int decode(struct dec_video *vd, struct demux_packet *packet, mp_set_av_packet(&pkt, packet); - // We merely pass-through our PTS as an int64_t; libavcodec won't use it. - union pts { int64_t i; double d; }; - pkt.pts = (union pts){.d = packet ? packet->pts : MP_NOPTS_VALUE}.i; ret = avcodec_decode_video2(avctx, ctx->pic, &got_picture, &pkt); if (ret < 0) { mp_msg(MSGT_DECVIDEO, MSGL_WARN, "Error while decoding frame!\n"); @@ -760,7 +757,7 @@ static int decode(struct dec_video *vd, struct demux_packet *packet, return 0; update_image_params(vd, ctx->pic); - double out_pts = (union pts){.i = ctx->pic->pkt_pts}.d; + double out_pts = mp_get_av_frame_pkt_pdts(ctx->pic); // Note: potentially resets ctx->pic as it is transferred to mpi struct mp_image *mpi = image_from_decoder(vd); -- cgit v1.2.3