MatroskaMuxContext *mkv = s->priv_data;
AVCodecContext *codec = s->streams[pkt->stream_index]->codec;
uint8_t *data = NULL;
- int size = pkt->size;
+ int offset = 0, size = pkt->size;
int64_t ts = mkv->tracks[pkt->stream_index].write_dts ? pkt->dts : pkt->pts;
av_log(s, AV_LOG_DEBUG, "Writing block at offset %" PRIu64 ", size %d, "
ff_avc_parse_nal_units_buf(pkt->data, &data, &size);
else
data = pkt->data;
+
+ if (codec->codec_id == AV_CODEC_ID_PRORES) {
+ /* Matroska specification requires to remove the first QuickTime atom
+ */
+ size -= 8;
+ offset = 8;
+ }
+
put_ebml_id(pb, blockid);
put_ebml_num(pb, size+4, 0);
avio_w8(pb, 0x80 | (pkt->stream_index + 1)); // this assumes stream_index is less than 126
avio_wb16(pb, ts - mkv->cluster_pts);
avio_w8(pb, flags);
- avio_write(pb, data, size);
+ avio_write(pb, data + offset, size);
if (data != pkt->data)
av_free(data);
}