aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/matroskaenc.c
diff options
context:
space:
mode:
authorTim Walker <tdskywalker@gmail.com>2014-03-03 14:53:45 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-03-09 18:09:40 +0100
commit558b20d729bc296d8e6a69f03cd509ad26a4827d (patch)
tree3d62897423b1af4106bd1dc1d43f67720c0af62e /libavformat/matroskaenc.c
parenta823d0948683bd97dd58556b5740e434166209a8 (diff)
downloadffmpeg-558b20d729bc296d8e6a69f03cd509ad26a4827d.tar.gz
matroskaenc: enable Annex B to MP4 conversion for HEVC tracks.
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r--libavformat/matroskaenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 3cb7eef25b..fad1ec41cc 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1167,6 +1167,10 @@ static void mkv_write_block(AVFormatContext *s, AVIOContext *pb,
if (codec->codec_id == AV_CODEC_ID_H264 && codec->extradata_size > 0 &&
(AV_RB24(codec->extradata) == 1 || AV_RB32(codec->extradata) == 1))
ff_avc_parse_nal_units_buf(pkt->data, &data, &size);
+ else if (codec->codec_id == AV_CODEC_ID_HEVC && codec->extradata_size > 6 &&
+ (AV_RB24(codec->extradata) == 1 || AV_RB32(codec->extradata) == 1))
+ /* extradata is Annex B, assume the bitstream is too and convert it */
+ ff_hevc_annexb2mp4_buf(pkt->data, &data, &size, 0, NULL);
else if (codec->codec_id == AV_CODEC_ID_WAVPACK) {
int ret = mkv_strip_wavpack(pkt->data, &data, &size);
if (ret < 0) {