summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-29 20:05:56 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-29 20:05:56 +0100
commit6d9c2c7423c15b1af1104fd1c3be7349b069f6c2 (patch)
treef2558d69e94b1f24f2795282ad5df91cdae8725b
parentd31792311cff5ef0af653b3eb9d9dd87d3b57ac5 (diff)
downloadadvtime-6d9c2c7423c15b1af1104fd1c3be7349b069f6c2.tar.gz
advtime-6d9c2c7423c15b1af1104fd1c3be7349b069f6c2.tar.bz2
advtime-6d9c2c7423c15b1af1104fd1c3be7349b069f6c2.zip
video_decode: Store cur_dts in a video frame
-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 {