From 6d9c2c7423c15b1af1104fd1c3be7349b069f6c2 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 29 Jan 2013 20:05:56 +0100 Subject: video_decode: Store cur_dts in a video frame --- src/advtime.c | 4 ++-- src/video_decode.c | 1 + src/video_decode.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/advtime.c b/src/advtime.c index 2316f13..e5b0297 100644 --- a/src/advtime.c +++ b/src/advtime.c @@ -173,7 +173,7 @@ main(int argc, char **argv) } if (diff > 40.0) { - start_new_szene(last_dts, vd->fmt_ctx->streams[1]->cur_dts); + start_new_szene(last_dts, frame_b->dts); if (!frame_flag && !average_flag) { printf("\n"); @@ -196,8 +196,8 @@ main(int argc, char **argv) fflush(stdout); } + last_dts = frame_b->dts; pswap((void **)&frame_a, (void **)&frame_b); - last_dts = vd->fmt_ctx->streams[1]->cur_dts; } if (diff_flag) { diff --git a/src/video_decode.c b/src/video_decode.c index defb6d7..6e3500a 100644 --- a/src/video_decode.c +++ b/src/video_decode.c @@ -152,6 +152,7 @@ video_decode_get_frame(struct video_decode *vd, struct video_frame **frame) f->base.width = vd->codec_ctx->width; 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 (*frame == NULL) *frame = &f->base; diff --git a/src/video_decode.h b/src/video_decode.h index 9da7f63..5b5d88c 100644 --- a/src/video_decode.h +++ b/src/video_decode.h @@ -12,6 +12,7 @@ struct video_decode; struct video_frame { uint8_t *data; int width, height, stride; + int64_t dts; }; struct video_decode { -- cgit