Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorv0lt <v0lt@users.sourceforge.net>2012-02-24 06:45:42 +0400
committerv0lt <v0lt@users.sourceforge.net>2012-02-24 06:45:42 +0400
commit8ea3a8e8924eda36e5ad5a6f0c6541ce0b2f43cf (patch)
tree61e31b1b6bcd4853ad8a30d2ee03fb9529a037bd /src/filters/parser/MP4Splitter/MP4Splitter.cpp
parente0971b6747cfd97f690d364ed054e99f8a8e7263 (diff)
MP4Splitter: alternative fix for r4096
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4099 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/MP4Splitter/MP4Splitter.cpp')
-rw-r--r--src/filters/parser/MP4Splitter/MP4Splitter.cpp79
1 files changed, 39 insertions, 40 deletions
diff --git a/src/filters/parser/MP4Splitter/MP4Splitter.cpp b/src/filters/parser/MP4Splitter/MP4Splitter.cpp
index 8d60e4469..4e05c6879 100644
--- a/src/filters/parser/MP4Splitter/MP4Splitter.cpp
+++ b/src/filters/parser/MP4Splitter/MP4Splitter.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2003-2006 Gabest
- * http://www.gabest.org
+ * (C) 2003-2006 Gabest
+ * (C) 2006-2012 see AUTHORS
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -593,44 +593,18 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
AP4_Atom* atom = item->GetData();
AP4_Atom::Type type = atom->GetType();
- DWORD fourcc;
-
- if ((type & 0xffff0000) == AP4_ATOM_TYPE('m', 's', 0, 0)) {
- fourcc = type & 0xffff;
- } else if (type == AP4_ATOM_TYPE_ALAW) {
- SetTrackName(&TrackName, _T("PCM A-law"));
- fourcc = WAVE_FORMAT_ALAW;
- } else if (type == AP4_ATOM_TYPE_ULAW) {
- SetTrackName(&TrackName, _T("PCM mu-law"));
- fourcc = WAVE_FORMAT_MULAW;
- } else if (type == AP4_ATOM_TYPE__MP3) {
- SetTrackName(&TrackName, _T("MPEG Audio (MP3)"));
- fourcc = WAVE_FORMAT_MPEGLAYER3;
- } else if ((type == AP4_ATOM_TYPE__AC3) || (type == AP4_ATOM_TYPE_SAC3) || (type == AP4_ATOM_TYPE_EAC3)) {
- if (type == AP4_ATOM_TYPE_EAC3) {
- SetTrackName(&TrackName, _T("AC-3 Audio"));
- } else {
- SetTrackName(&TrackName, _T("Enhanced AC-3 audio"));
- }
- fourcc = 0x2000;
- } else if (type == AP4_ATOM_TYPE_MP4A) {
- SetTrackName(&TrackName, _T("MPEG-2 Audio AAC"));
- fourcc = WAVE_FORMAT_AAC;
- } else if (type == AP4_ATOM_TYPE_NMOS) {
- SetTrackName(&TrackName, _T("NellyMoser Audio"));
- fourcc = MAKEFOURCC('N','E','L','L');
- } else {
+ DWORD fourcc =
+ ((type >> 24) & 0x000000ff) |
+ ((type >> 8) & 0x0000ff00) |
+ ((type << 8) & 0x00ff0000) |
+ ((type << 24) & 0xff000000);
+
+ if (AP4_VisualSampleEntry* vse = dynamic_cast<AP4_VisualSampleEntry*>(atom)) {
+
if (type == AP4_ATOM_TYPE_MJPA || type == AP4_ATOM_TYPE_MJPB || type == AP4_ATOM_TYPE_MJPG) {
- SetTrackName(&TrackName, _T("MJpeg"));
+ SetTrackName(&TrackName, _T("M-Jpeg"));
}
- fourcc =
- ((type >> 24) & 0x000000ff) |
- ((type >> 8) & 0x0000ff00) |
- ((type << 8) & 0x00ff0000) |
- ((type << 24) & 0xff000000);
- }
- if (AP4_VisualSampleEntry* vse = dynamic_cast<AP4_VisualSampleEntry*>(atom)) {
mt.majortype = MEDIATYPE_Video;
mt.subtype = FOURCCMap(fourcc);
mt.formattype = FORMAT_VideoInfo;
@@ -668,9 +642,34 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
break;
} else if (AP4_AudioSampleEntry* ase = dynamic_cast<AP4_AudioSampleEntry*>(atom)) {
- if (ase->GetEndian()==1 &&
- (type==AP4_ATOM_TYPE_IN24 || type==AP4_ATOM_TYPE_IN32 ||
- type==AP4_ATOM_TYPE_FL32 || type==AP4_ATOM_TYPE_FL64)) {
+ // overwrite audio fourc
+ if ((type & 0xffff0000) == AP4_ATOM_TYPE('m', 's', 0, 0)) {
+ fourcc = type & 0xffff;
+ } else if (type == AP4_ATOM_TYPE_ALAW) {
+ fourcc = WAVE_FORMAT_ALAW;
+ SetTrackName(&TrackName, _T("PCM A-law"));
+ } else if (type == AP4_ATOM_TYPE_ULAW) {
+ fourcc = WAVE_FORMAT_MULAW;
+ SetTrackName(&TrackName, _T("PCM mu-law"));
+ } else if (type == AP4_ATOM_TYPE__MP3) {
+ SetTrackName(&TrackName, _T("MPEG Audio (MP3)"));
+ fourcc = WAVE_FORMAT_MPEGLAYER3;
+ } else if ((type == AP4_ATOM_TYPE__AC3) || (type == AP4_ATOM_TYPE_SAC3) || (type == AP4_ATOM_TYPE_EAC3)) {
+ fourcc = 0x2000;
+ if (type == AP4_ATOM_TYPE_EAC3) {
+ SetTrackName(&TrackName, _T("AC-3 Audio"));
+ } else {
+ SetTrackName(&TrackName, _T("Enhanced AC-3 audio"));
+ }
+ } else if (type == AP4_ATOM_TYPE_MP4A) {
+ fourcc = WAVE_FORMAT_AAC;
+ SetTrackName(&TrackName, _T("MPEG-2 Audio AAC"));
+ } else if (type == AP4_ATOM_TYPE_NMOS) {
+ fourcc = MAKEFOURCC('N','E','L','L');
+ SetTrackName(&TrackName, _T("NellyMoser Audio"));
+ } else if (ase->GetEndian()==1 &&
+ (type==AP4_ATOM_TYPE_IN24 || type==AP4_ATOM_TYPE_IN32 ||
+ type==AP4_ATOM_TYPE_FL32 || type==AP4_ATOM_TYPE_FL64)) {
fourcc = type; //reverse fourcc
}