diff options
author | wm4 <wm4@nowhere> | 2013-11-25 23:13:01 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-25 23:13:01 +0100 |
commit | 9f72a9753e68c4064796f2361fb12492a85a8e0b (patch) | |
tree | 438a52f708e95ff08be4a686fa7beec937f2fdbf /video/decode/vd_lavc.c | |
parent | d8b59aa17fda6aff7bf3031abbd716adc1268422 (diff) | |
download | mpv-9f72a9753e68c4064796f2361fb12492a85a8e0b.tar.bz2 mpv-9f72a9753e68c4064796f2361fb12492a85a8e0b.tar.xz |
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.
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r-- | video/decode/vd_lavc.c | 5 |
1 files changed, 1 insertions, 4 deletions
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); |