]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cngenc.c
avcodec/qsvenc: Set MaxKpbs to rc_max_rate for CBR and VBR (bitrate is equal to rc_ma...
[ffmpeg] / libavcodec / cngenc.c
index 58918aa95836394137b629da84cd45e11e04537f..302c703f7216ae3163452b8160ccf8b55f3928a2 100644 (file)
@@ -75,7 +75,7 @@ static int cng_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     int qdbov;
     int16_t *samples = (int16_t*) frame->data[0];
 
-    if ((ret = ff_alloc_packet(avpkt, 1 + p->order))) {
+    if ((ret = ff_alloc_packet2(avctx, avpkt, 1 + p->order, 1 + p->order))) {
         av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
         return ret;
     }
@@ -97,7 +97,7 @@ static int cng_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
         avpkt->data[1 + i] = p->ref_coef[i] * 127 + 127;
 
     *got_packet_ptr = 1;
-    avpkt->size = 1 + p->order;
+    av_assert1(avpkt->size == 1 + p->order);
 
     return 0;
 }