]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/avuienc.c
Merge commit '31dc73e92a96f08d07650c0e7d31c0b9a1465d46'
[ffmpeg] / libavcodec / avuienc.c
index db640bb5a990c96424f07076ebbbb74486c9ba1f..4b1b4086ec9363eb0481c9b2caa5c3f4db90bfdb 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "avcodec.h"
 #include "internal.h"
+#include "libavutil/intreadwrite.h"
 
 static av_cold int avui_encode_init(AVCodecContext *avctx)
 {
@@ -29,15 +30,19 @@ static av_cold int avui_encode_init(AVCodecContext *avctx)
         av_log(avctx, AV_LOG_ERROR, "Only 720x486 and 720x576 are supported.\n");
         return AVERROR(EINVAL);
     }
-    if (!(avctx->extradata = av_mallocz(24 + FF_INPUT_BUFFER_PADDING_SIZE)))
+    if (!(avctx->extradata = av_mallocz(144 + FF_INPUT_BUFFER_PADDING_SIZE)))
         return AVERROR(ENOMEM);
-    avctx->extradata_size = 24;
+    avctx->extradata_size = 144;
     memcpy(avctx->extradata, "\0\0\0\x18""APRGAPRG0001", 16);
     if (avctx->field_order > AV_FIELD_PROGRESSIVE) {
         avctx->extradata[19] = 2;
     } else {
         avctx->extradata[19] = 1;
     }
+    memcpy(avctx->extradata + 24, "\0\0\0\x78""ARESARES0001""\0\0\0\x98", 20);
+    AV_WB32(avctx->extradata + 44, avctx->width);
+    AV_WB32(avctx->extradata + 48, avctx->height);
+    memcpy(avctx->extradata + 52, "\0\0\0\x1\0\0\0\x20\0\0\0\x2", 12);
 
     avctx->coded_frame = av_frame_alloc();
     if (!avctx->coded_frame) {