summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/advtime.c4
-rw-r--r--src/video_decode.c1
-rw-r--r--src/video_decode.h1
3 files changed, 4 insertions, 2 deletions
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 {