TrueHD: parse input timing

This commit is contained in:
Moritz Bunkus 2019-12-30 15:58:11 +01:00
parent 6749045212
commit a18fe530f2
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
2 changed files with 8 additions and 2 deletions

View File

@ -113,7 +113,13 @@ frame_t::parse_truehd_header(unsigned char const *data,
static debugging_option_c s_debug{"truehd_atmos"};
try {
mtx::bits::reader_c r{&data[8], size - 8};
mtx::bits::reader_c r{data, size};
r.skip_bits(4 + 12); // check_nibble, access_unit_length
m_input_timing = r.get_bits(16);
r.skip_bits(32); // format_sync
auto rate_bits = r.get_bits(4);
m_samples_per_frame = 40 << (rate_bits & 0x07);

View File

@ -45,7 +45,7 @@ struct frame_t {
codec_e m_codec{truehd};
frame_type_e m_type{invalid};
int m_size{}, m_sampling_rate{}, m_channels{}, m_samples_per_frame{};
unsigned int m_header_size{};
unsigned int m_header_size{}, m_input_timing{};
bool m_contains_atmos{};
mtx::ac3::frame_c m_ac3_header;