From 7f1ea38868e9d1e4f9814cc34ce7d50e38aa93fc Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Wed, 18 Mar 2015 20:34:35 +0100 Subject: [PATCH 1/2] lavc/dts: Do not set bitrate for DTS-HD Master and High Resolution. Fixes ticket #4375. Reviewed-by: Hendrik Leppkes --- libavcodec/dcadec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index 548a5f9978..0339eef340 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -1472,7 +1472,6 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data, } // set AVCodec values with parsed data avctx->sample_rate = s->sample_rate; - avctx->bit_rate = s->bit_rate; s->profile = FF_PROFILE_DTS; @@ -1937,6 +1936,9 @@ FF_ENABLE_DEPRECATION_WARNINGS if (ret < 0) return ret; + if ( avctx->profile != FF_PROFILE_DTS_HD_MA + && avctx->profile != FF_PROFILE_DTS_HD_HRA) + avctx->bit_rate = s->bit_rate; *got_frame_ptr = 1; return buf_size; From 7a5356c7281d39ee168bfa984ae081969e47da27 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Wed, 18 Mar 2015 20:35:26 +0100 Subject: [PATCH 2/2] lavf/mkv: Ignore ff_isom_write_hvcc() return value as the mov muxer does. This change allows remuxing hevc from mpeg-ts to Matroska. --- libavformat/matroskaenc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index be4d689bfe..40f903b68f 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -605,8 +605,9 @@ static int mkv_write_native_codecprivate(AVFormatContext *s, return ff_isom_write_avcc(dyn_cp, codec->extradata, codec->extradata_size); case AV_CODEC_ID_HEVC: - return ff_isom_write_hvcc(dyn_cp, codec->extradata, - codec->extradata_size, 0); + ff_isom_write_hvcc(dyn_cp, codec->extradata, + codec->extradata_size, 0); + return 0; case AV_CODEC_ID_ALAC: if (codec->extradata_size < 36) { av_log(s, AV_LOG_ERROR,