]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libtheoraenc.c
Fix typo in v410 decoder.
[ffmpeg] / libavcodec / libtheoraenc.c
index 30a4b285ffeb1fa083772b65c15d5d17d4ea5e18..45712d48c2468228f720016c8df197433393d685 100644 (file)
@@ -328,10 +328,8 @@ static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt,
     }
 
     /* Copy ogg_packet content out to buffer */
-    if ((ret = ff_alloc_packet(pkt, o_packet.bytes)) < 0) {
-        av_log(avc_context, AV_LOG_ERROR, "Error getting output packet of size %ld.\n", o_packet.bytes);
+    if ((ret = ff_alloc_packet2(avc_context, pkt, o_packet.bytes)) < 0)
         return ret;
-    }
     memcpy(pkt->data, o_packet.packet, o_packet.bytes);
 
     // HACK: assumes no encoder delay, this is true until libtheora becomes
@@ -361,14 +359,16 @@ static av_cold int encode_close(AVCodecContext* avc_context)
 
 /** AVCodec struct exposed to libavcodec */
 AVCodec ff_libtheora_encoder = {
-    .name = "libtheora",
-    .type = AVMEDIA_TYPE_VIDEO,
-    .id = CODEC_ID_THEORA,
+    .name           = "libtheora",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_THEORA,
     .priv_data_size = sizeof(TheoraContext),
-    .init = encode_init,
-    .close = encode_close,
-    .encode2 = encode_frame,
-    .capabilities = CODEC_CAP_DELAY, // needed to get the statsfile summary
-    .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE},
-    .long_name = NULL_IF_CONFIG_SMALL("libtheora Theora"),
+    .init           = encode_init,
+    .close          = encode_close,
+    .encode2        = encode_frame,
+    .capabilities   = CODEC_CAP_DELAY, // needed to get the statsfile summary
+    .pix_fmts       = (const enum PixelFormat[]){
+        PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE
+    },
+    .long_name      = NULL_IF_CONFIG_SMALL("libtheora Theora"),
 };