summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-20 22:25:53 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-20 22:25:53 +0200
commitb97e3e11a9c23e45ac3b2c1a7771d55f8fc1caee (patch)
treeceb13c3b2a682800cbb5abd050039d96838264fc /libavcodec
parent256430cf384d34c15a9ec579fbf48708502ab5f4 (diff)
parent10a9149de242c7bbc4e130d3d7c593b89e20f80e (diff)
downloadffmpeg-streaming-b97e3e11a9c23e45ac3b2c1a7771d55f8fc1caee.zip
ffmpeg-streaming-b97e3e11a9c23e45ac3b2c1a7771d55f8fc1caee.tar.gz
Merge commit '10a9149de242c7bbc4e130d3d7c593b89e20f80e'
* commit '10a9149de242c7bbc4e130d3d7c593b89e20f80e': ffv1enc: Keep coded_frame.key_frame a write-only variable Conflicts: libavcodec/ffv1.h libavcodec/ffv1enc.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ffv1.h1
-rw-r--r--libavcodec/ffv1enc.c10
2 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/ffv1.h b/libavcodec/ffv1.h
index bfc4d71..ed347e2 100644
--- a/libavcodec/ffv1.h
+++ b/libavcodec/ffv1.h
@@ -87,6 +87,7 @@ typedef struct FFV1Context {
int transparency;
int flags;
int picture_number;
+ int key_frame;
ThreadFrame picture, last_picture;
struct FFV1Context *fsrc;
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index a47a64d..02e7f07 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -1138,7 +1138,7 @@ static int encode_slice(AVCodecContext *c, void *arg)
}
retry:
- if (c->coded_frame->key_frame)
+ if (f->key_frame)
ffv1_clear_slice_state(f, fs);
if (f->version > 2) {
encode_slice_header(f, fs);
@@ -1260,12 +1260,12 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (avctx->gop_size == 0 || f->picture_number % avctx->gop_size == 0) {
put_rac(c, &keystate, 1);
- avctx->coded_frame->key_frame = 1;
+ f->key_frame = 1;
f->gob_count++;
write_header(f);
} else {
put_rac(c, &keystate, 0);
- avctx->coded_frame->key_frame = 0;
+ f->key_frame = 0;
}
if (f->ac > 1) {
@@ -1318,11 +1318,13 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (avctx->flags & CODEC_FLAG_PASS1)
avctx->stats_out[0] = '\0';
+ avctx->coded_frame->key_frame = f->key_frame;
+
f->picture_number++;
pkt->size = buf_p - pkt->data;
pkt->pts =
pkt->dts = pict->pts;
- pkt->flags |= AV_PKT_FLAG_KEY * avctx->coded_frame->key_frame;
+ pkt->flags |= AV_PKT_FLAG_KEY * f->key_frame;
*got_packet = 1;
return 0;
OpenPOWER on IntegriCloud