diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-16 00:23:50 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-19 11:59:42 +0100 |
commit | f9b8b89b75fa0afa06ed6be1579b80cd73086c33 (patch) | |
tree | 37dbcb18e38ce984a1025f013e3b6ea33d43d1b2 /libavformat | |
parent | 83186275588c6482da5d4abb827914252736655a (diff) | |
download | ffmpeg-f9b8b89b75fa0afa06ed6be1579b80cd73086c33.tar.gz |
avformat/matroskaenc: Use common function for H.2645 annex B->mp4
Matroska does not have different profiles that allow or disallow
in-band extradata, so one can just use the ordinary H.264 function
for H.265, too. (Both use ff_avc_parse_nal_units() internally anyway.)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskaenc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index a71fd9c6e5..5b0ee32ec0 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -2427,13 +2427,10 @@ static int mkv_write_block(AVFormatContext *s, AVIOContext *pb, mkv->cluster_pos, track_number, keyframe != 0); #if CONFIG_MATROSKA_MUXER - if (par->codec_id == AV_CODEC_ID_H264 && par->extradata_size > 0 && + if ((par->codec_id == AV_CODEC_ID_H264 && par->extradata_size > 0 || + par->codec_id == AV_CODEC_ID_HEVC && par->extradata_size > 6) && (AV_RB24(par->extradata) == 1 || AV_RB32(par->extradata) == 1)) { err = ff_avc_parse_nal_units_buf(pkt->data, &data, &size); - } else if (par->codec_id == AV_CODEC_ID_HEVC && par->extradata_size > 6 && - (AV_RB24(par->extradata) == 1 || AV_RB32(par->extradata) == 1)) { - /* extradata is Annex B, assume the bitstream is too and convert it */ - err = ff_hevc_annexb2mp4_buf(pkt->data, &data, &size, 0, NULL); } else #endif if (track->reformat) { |