diff options
author | Aleksoid <aleksoid@users.sourceforge.net> | 2012-02-24 03:29:10 +0400 |
---|---|---|
committer | Aleksoid <aleksoid@users.sourceforge.net> | 2012-02-24 03:29:10 +0400 |
commit | e0971b6747cfd97f690d364ed054e99f8a8e7263 (patch) | |
tree | 92f8afb0c5a72780f8c4f1cf9d0c3dc80ab4b4e2 /src/filters/parser/MP4Splitter/MP4Splitter.cpp | |
parent | d2ed638f37946d031a75d75a195ad5b4d42a1382 (diff) |
Fix : MP4Splitter after rev. 4096 set incorrect subtype for some video stream; Add name for some stream type;
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4098 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/MP4Splitter/MP4Splitter.cpp')
-rw-r--r-- | src/filters/parser/MP4Splitter/MP4Splitter.cpp | 70 |
1 files changed, 38 insertions, 32 deletions
diff --git a/src/filters/parser/MP4Splitter/MP4Splitter.cpp b/src/filters/parser/MP4Splitter/MP4Splitter.cpp index 7e7b1f17b..8d60e4469 100644 --- a/src/filters/parser/MP4Splitter/MP4Splitter.cpp +++ b/src/filters/parser/MP4Splitter/MP4Splitter.cpp @@ -595,6 +595,41 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) 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 {
+ if (type == AP4_ATOM_TYPE_MJPA || type == AP4_ATOM_TYPE_MJPB || type == AP4_ATOM_TYPE_MJPG) {
+ SetTrackName(&TrackName, _T("MJpeg"));
+ }
+ 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);
@@ -633,39 +668,10 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) break;
} else if (AP4_AudioSampleEntry* ase = dynamic_cast<AP4_AudioSampleEntry*>(atom)) {
-
- if ((type & 0xffff0000) == AP4_ATOM_TYPE('m', 's', 0, 0)) {
- fourcc = type & 0xffff;
- } else if (type == AP4_ATOM_TYPE_ALAW) {
- fourcc = WAVE_FORMAT_ALAW;
- } else if (type == AP4_ATOM_TYPE_ULAW) {
- 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)) {
- 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)) {
+ 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
- } else {
- fourcc =
- ((type >> 24) & 0x000000ff) |
- ((type >> 8) & 0x0000ff00) |
- ((type << 8) & 0x00ff0000) |
- ((type << 24) & 0xff000000);
}
DWORD nSampleRate = ase->GetSampleRate();
|