Skip to content

Commit

Permalink
Add support for reading .mp3 boxes in stsd.
Browse files Browse the repository at this point in the history
This is used by Quicktime for MP3 tracks.

Issue: #2066

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139209989
  • Loading branch information
andrewlewis authored and ojw28 committed Nov 18, 2016
1 parent 21e3361 commit 0effffb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
public static final int TYPE_d263 = Util.getIntegerCodeForString("d263");
public static final int TYPE_mdat = Util.getIntegerCodeForString("mdat");
public static final int TYPE_mp4a = Util.getIntegerCodeForString("mp4a");
public static final int TYPE__mp3 = Util.getIntegerCodeForString(".mp3");
public static final int TYPE_wave = Util.getIntegerCodeForString("wave");
public static final int TYPE_lpcm = Util.getIntegerCodeForString("lpcm");
public static final int TYPE_sowt = Util.getIntegerCodeForString("sowt");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,8 @@ private static StsdData parseStsd(ParsableByteArray stsd, int trackId, int rotat
|| childAtomType == Atom.TYPE_dtsc || childAtomType == Atom.TYPE_dtse
|| childAtomType == Atom.TYPE_dtsh || childAtomType == Atom.TYPE_dtsl
|| childAtomType == Atom.TYPE_samr || childAtomType == Atom.TYPE_sawb
|| childAtomType == Atom.TYPE_lpcm || childAtomType == Atom.TYPE_sowt) {
|| childAtomType == Atom.TYPE_lpcm || childAtomType == Atom.TYPE_sowt
|| childAtomType == Atom.TYPE__mp3) {
parseAudioSampleEntry(stsd, childAtomType, childStartPosition, childAtomSize, trackId,
language, isQuickTime, drmInitData, out, i);
} else if (childAtomType == Atom.TYPE_TTML) {
Expand Down Expand Up @@ -829,6 +830,8 @@ private static void parseAudioSampleEntry(ParsableByteArray parent, int atomType
mimeType = MimeTypes.AUDIO_AMR_WB;
} else if (atomType == Atom.TYPE_lpcm || atomType == Atom.TYPE_sowt) {
mimeType = MimeTypes.AUDIO_RAW;
} else if (atomType == Atom.TYPE__mp3) {
mimeType = MimeTypes.AUDIO_MPEG;
}

byte[] initializationData = null;
Expand Down

0 comments on commit 0effffb

Please sign in to comment.