]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/y41penc.c
ffmpeg: preserve bits_per_coded sample on stream copy.
[ffmpeg] / libavcodec / y41penc.c
index 1b81a5243ad85873b0c4f1483cc378b92bc681b7..aafae8ee8d1035328b5f4246e5c586fe9dac4273 100644 (file)
@@ -48,10 +48,8 @@ static int y41p_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     uint8_t *y, *u, *v;
     int i, j, ret;
 
-    if ((ret = ff_alloc_packet(pkt, avctx->width * avctx->height * 1.5)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Out buffer is too small.\n");
+    if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 1.5)) < 0)
         return ret;
-    }
 
     avctx->coded_frame->reference = 0;
     avctx->coded_frame->key_frame = 1;
@@ -80,7 +78,6 @@ static int y41p_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         }
     }
 
-    pkt->size   = 1.5 * avctx->width * avctx->height;
     pkt->flags |= AV_PKT_FLAG_KEY;
     *got_packet = 1;
     return 0;