summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_decode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/video_decode.c b/src/video_decode.c
index dc5d00e..13bf0e1 100644
--- a/src/video_decode.c
+++ b/src/video_decode.c
@@ -172,6 +172,8 @@ video_decode_get_frame(struct video_decode *_vd, struct video_frame **frame)
f->base.height = vd->codec_ctx->height;
f->base.stride = f->frame->linesize[0];
f->base.dts = vd->fmt_ctx->streams[vd->stream]->cur_dts;
+ if (vd->fmt_ctx->start_time != AV_NOPTS_VALUE)
+ f->base.dts -= vd->fmt_ctx->start_time;
if (*frame == NULL)
*frame = &f->base;