diff options
author | v0lt <v0lt@rambler.ru> | 2013-02-14 23:41:14 +0400 |
---|---|---|
committer | v0lt <v0lt@rambler.ru> | 2013-02-14 23:41:14 +0400 |
commit | 5ff888380f87308351c8261b4063731648593753 (patch) | |
tree | ae1bb30ef3fa4f9ec66123563eb56caf847ea9c8 /src/DSUtil/AudioParser.cpp | |
parent | a422cb2db0ef2f4a497ba10cd407e2c04eee6b47 (diff) |
AudioParser: added GetDTSHDFrameSize function
Diffstat (limited to 'src/DSUtil/AudioParser.cpp')
-rw-r--r-- | src/DSUtil/AudioParser.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/DSUtil/AudioParser.cpp b/src/DSUtil/AudioParser.cpp index d526e9e8d..77923d362 100644 --- a/src/DSUtil/AudioParser.cpp +++ b/src/DSUtil/AudioParser.cpp @@ -100,6 +100,22 @@ int GetMLPFrameSize(const BYTE* buf) return 0;
}
+int GetDTSHDFrameSize(const BYTE *buf)
+{
+ if (*(DWORD*)buf != DTSHD_SYNC_WORD) { // syncword
+ return 0;
+ }
+
+ int frame_size;
+ BYTE isBlownUpHeader = (buf[5] >> 5) & 1;
+ if (isBlownUpHeader) {
+ frame_size = ((buf[6] & 1) << 19 | buf[7] << 11 | buf[8] << 3 | buf[9] >> 5) + 1;
+ } else {
+ frame_size = ((buf[6] & 31) << 11 | buf[7] << 3 | buf[8] >> 5) + 1;
+ }
+
+ return frame_size;
+}
int ParseAC3Header(const BYTE* buf, int* samplerate, int* channels, int* framelength, int* bitrate)
{
|