libtheoraenc: Keep coded_frame.key_frame a write-only variable
authorVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 15 Jul 2015 17:41:15 +0000 (18:41 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 20 Jul 2015 13:13:42 +0000 (14:13 +0100)
libavcodec/libtheoraenc.c

index 097336b..612a808 100644 (file)
@@ -349,7 +349,7 @@ static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt,
     // multithreaded (which will be disabled unless explicitly requested)
     pkt->pts = pkt->dts = frame->pts;
     avc_context->coded_frame->key_frame = !(o_packet.granulepos & h->keyframe_mask);
-    if (avc_context->coded_frame->key_frame)
+    if (!(o_packet.granulepos & h->keyframe_mask))
         pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;