summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2015-01-29 01:07:08 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2015-01-29 01:07:08 +0100
commit3ea97767e49c599813d6a09c640a657d71c1a0de (patch)
tree31dcce34ccb2cb8c0cf49324c10b834443f5d61c /libavcodec
parent72db3c79dfddbeae82c540c785c680654a77b063 (diff)
Add an ARES atom to extradata when encoding avui.
Allows playback with QuickTime and the original codec. Tested by Olaf Matthes, olaf matthes gmx de
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avuienc.c9
-rw-r--r--libavcodec/version.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/libavcodec/avuienc.c b/libavcodec/avuienc.c
index db640bb5a9..4b1b4086ec 100644
--- a/libavcodec/avuienc.c
+++ b/libavcodec/avuienc.c
@@ -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) {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index dfb95e098f..3827c38f69 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
#define LIBAVCODEC_VERSION_MAJOR 56
#define LIBAVCODEC_VERSION_MINOR 21
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \