projects
/
ffmpeg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit '117d8c6d1f1c187ffc6098d9618457e00534e013'
[ffmpeg.git]
/
libavformat
/
matroskadec.c
diff --git
a/libavformat/matroskadec.c
b/libavformat/matroskadec.c
index
5dd8dd5
..
bc0f728
100644
(file)
--- a/
libavformat/matroskadec.c
+++ b/
libavformat/matroskadec.c
@@
-37,6
+37,7
@@
#include "isom.h"
#include "rm.h"
#include "matroska.h"
#include "isom.h"
#include "rm.h"
#include "matroska.h"
+#include "libavcodec/bytestream.h"
#include "libavcodec/mpeg4audio.h"
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "libavcodec/mpeg4audio.h"
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
@@
-1615,7
+1616,7
@@
static int matroska_read_header(AVFormatContext *s)
Create the "atom size", "tag", and "tag version" fields the
decoder expects manually. */
extradata_size = 12 + track->codec_priv.size;
Create the "atom size", "tag", and "tag version" fields the
decoder expects manually. */
extradata_size = 12 + track->codec_priv.size;
- extradata = av_mallocz(extradata_size);
+ extradata = av_mallocz(extradata_size
+ FF_INPUT_BUFFER_PADDING_SIZE
);
if (extradata == NULL)
return AVERROR(ENOMEM);
AV_WB32(extradata, extradata_size);
if (extradata == NULL)
return AVERROR(ENOMEM);
AV_WB32(extradata, extradata_size);
@@
-2117,6
+2118,7
@@
static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
MatroskaTrackEncoding *encodings = track->encodings.elem;
uint32_t pkt_size = lace_size[n];
uint8_t *pkt_data = data;
MatroskaTrackEncoding *encodings = track->encodings.elem;
uint32_t pkt_size = lace_size[n];
uint8_t *pkt_data = data;
+ int offset = 0;
if (encodings && encodings->scope & 1) {
res = matroska_decode_buffer(&pkt_data, &pkt_size, track);
if (encodings && encodings->scope & 1) {
res = matroska_decode_buffer(&pkt_data, &pkt_size, track);
@@
-2124,15
+2126,24
@@
static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
break;
}
break;
}
+ if (st->codec->codec_id == AV_CODEC_ID_PRORES)
+ offset = 8;
+
pkt = av_mallocz(sizeof(AVPacket));
/* XXX: prevent data copy... */
pkt = av_mallocz(sizeof(AVPacket));
/* XXX: prevent data copy... */
- if (av_new_packet(pkt, pkt_size) < 0) {
+ if (av_new_packet(pkt, pkt_size
+ offset
) < 0) {
av_free(pkt);
res = AVERROR(ENOMEM);
break;
}
av_free(pkt);
res = AVERROR(ENOMEM);
break;
}
- memcpy(pkt->data, pkt_data, pkt_size);
+ if (st->codec->codec_id == AV_CODEC_ID_PRORES) {
+ uint8_t *buf = pkt->data;
+ bytestream_put_be32(&buf, pkt_size);
+ bytestream_put_be32(&buf, MKBETAG('i', 'c', 'p', 'f'));
+ }
+
+ memcpy(pkt->data + offset, pkt_data, pkt_size);
if (pkt_data != data)
av_free(pkt_data);
if (pkt_data != data)
av_free(pkt_data);