Commit c43d4858 authored by Hendrik Leppkes's avatar Hendrik Leppkes

matroskaenc: set the actual PCM bitdepth in the header

The actual bitdepth can be different to the storage format (ie. sample format).
Fixes the stored bitdepth for 24-bit formats like FLAC.
parent 109dfed7
...@@ -850,8 +850,12 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv, ...@@ -850,8 +850,12 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
return 0; return 0;
} }
if (!bit_depth && codec->codec_id != AV_CODEC_ID_ADPCM_G726) if (!bit_depth && codec->codec_id != AV_CODEC_ID_ADPCM_G726) {
if (codec->bits_per_raw_sample)
bit_depth = codec->bits_per_raw_sample;
else
bit_depth = av_get_bytes_per_sample(codec->sample_fmt) << 3; bit_depth = av_get_bytes_per_sample(codec->sample_fmt) << 3;
}
if (!bit_depth) if (!bit_depth)
bit_depth = codec->bits_per_coded_sample; bit_depth = codec->bits_per_coded_sample;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment