diff options
author | wm4 <wm4@nowhere> | 2016-03-24 16:38:14 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-03-24 16:38:14 +0100 |
commit | b34befbab8b7d42447592a3c6652fbf73d51f762 (patch) | |
tree | 622dc58a9ef571679dcd0282dbb654218a8c7e08 /video/decode/vd_lavc.c | |
parent | 30e94fa71127eb1a848fd44f7268f1e2dd9a02c5 (diff) | |
download | mpv-b34befbab8b7d42447592a3c6652fbf73d51f762.tar.bz2 mpv-b34befbab8b7d42447592a3c6652fbf73d51f762.tar.xz |
vd_lavc: slightly improve codec_timebase hack
The mp_set_av_packet()/mp_pts_from_av() functions check whether the
timebase is set at all (i.e. AVRational.num!=0), so there's no need to
fiddle with pointers.
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r-- | video/decode/vd_lavc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 7217b2b9e7..56633c0227 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -646,7 +646,6 @@ static void decode(struct dec_video *vd, struct demux_packet *packet, vd_ffmpeg_ctx *ctx = vd->priv; AVCodecContext *avctx = ctx->avctx; struct vd_lavc_params *opts = ctx->opts->vd_lavc_params; - AVRational *tb = ctx->codec_timebase.num ? &ctx->codec_timebase : NULL; AVPacket pkt; if (!avctx) @@ -660,7 +659,7 @@ static void decode(struct dec_video *vd, struct demux_packet *packet, avctx->skip_frame = ctx->skip_frame; } - mp_set_av_packet(&pkt, packet, tb); + mp_set_av_packet(&pkt, packet, &ctx->codec_timebase); ctx->flushing |= !pkt.data; // Reset decoder if hw state got reset, or new data comes during flushing. @@ -723,8 +722,8 @@ static void decode(struct dec_video *vd, struct demux_packet *packet, return; } assert(mpi->planes[0] || mpi->planes[3]); - mpi->pts = mp_pts_from_av(ctx->pic->pkt_pts, tb); - mpi->dts = mp_pts_from_av(ctx->pic->pkt_dts, tb); + mpi->pts = mp_pts_from_av(ctx->pic->pkt_pts, &ctx->codec_timebase); + mpi->dts = mp_pts_from_av(ctx->pic->pkt_dts, &ctx->codec_timebase); struct mp_image_params params; update_image_params(vd, ctx->pic, ¶ms); |