diff options
author | v0lt <v0lt@users.sourceforge.net> | 2012-04-22 10:47:18 +0400 |
---|---|---|
committer | v0lt <v0lt@users.sourceforge.net> | 2012-04-22 10:47:18 +0400 |
commit | 58ded6dbb0a199cfe63f55c18be0049f055f1cb7 (patch) | |
tree | dcd520cb6304f3711cd7ee1608c8a74f048dcdc0 /src/filters/parser/MP4Splitter/MP4Splitter.cpp | |
parent | 31d4af200cff11f497534787f26c8cd8fa32fe38 (diff) |
MP4Splitter: more correct to add extra data for the audio formats.
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4465 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/MP4Splitter/MP4Splitter.cpp')
-rw-r--r-- | src/filters/parser/MP4Splitter/MP4Splitter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/filters/parser/MP4Splitter/MP4Splitter.cpp b/src/filters/parser/MP4Splitter/MP4Splitter.cpp index 935f081ce..862a008ac 100644 --- a/src/filters/parser/MP4Splitter/MP4Splitter.cpp +++ b/src/filters/parser/MP4Splitter/MP4Splitter.cpp @@ -1044,7 +1044,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) mt.majortype = MEDIATYPE_Audio;
mt.formattype = FORMAT_WaveFormatEx;
- wfe = (WAVEFORMATEX*)mt.AllocFormatBuffer(sizeof(WAVEFORMATEX) + (type == AP4_ATOM_TYPE_MP4A ? 0 : type == AP4_ATOM_TYPE_ALAC ? 36 : db.GetDataSize()));
+ wfe = (WAVEFORMATEX*)mt.AllocFormatBuffer(sizeof(WAVEFORMATEX));
memset(wfe, 0, mt.FormatLength());
if (!(fourcc & 0xffff0000)) {
wfe->wFormatTag = (WORD)fourcc;
@@ -1102,10 +1102,12 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) }
if (size >= 36) {
+ wfe = (WAVEFORMATEX*)mt.ReallocFormatBuffer(sizeof(WAVEFORMATEX) + 36);
wfe->cbSize = 36;
memcpy(wfe+1, data, 36);
}
- } else {
+ } else if (db.GetDataSize() > 0) {
+ wfe = (WAVEFORMATEX*)mt.ReallocFormatBuffer(sizeof(WAVEFORMATEX) + db.GetDataSize());
wfe->cbSize = db.GetDataSize();
memcpy(wfe+1, db.GetData(), db.GetDataSize());
}
|