Skip to content

Commit

Permalink
Add support for mp2 boxes.
Browse files Browse the repository at this point in the history
Issue: #7967
PiperOrigin-RevId: 333709003
  • Loading branch information
Samrobbo authored and kim-vde committed Sep 25, 2020
1 parent 0066586 commit 851ca20
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
* Add support for `\h` SSA/ASS style override code (non-breaking space).
* Audio:
* Retry playback after some types of `AudioTrack` error.
* Extractors:
* Add support for .mp2 boxes in the `AtomParsers`
([#7967](https://github.com/google/ExoPlayer/issues/7967)).

### 2.12.0 (2020-09-11) ###

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@
@SuppressWarnings("ConstantCaseForConstants")
public static final int TYPE_mp4a = 0x6d703461;

@SuppressWarnings("ConstantCaseForConstants")
public static final int TYPE__mp2 = 0x2e6d7032;

@SuppressWarnings("ConstantCaseForConstants")
public static final int TYPE__mp3 = 0x2e6d7033;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@ private static StsdData parseStsd(
|| childAtomType == Atom.TYPE_lpcm
|| childAtomType == Atom.TYPE_sowt
|| childAtomType == Atom.TYPE_twos
|| childAtomType == Atom.TYPE__mp2
|| childAtomType == Atom.TYPE__mp3
|| childAtomType == Atom.TYPE_alac
|| childAtomType == Atom.TYPE_alaw
Expand Down Expand Up @@ -1243,7 +1244,7 @@ private static void parseAudioSampleEntry(
} else if (atomType == Atom.TYPE_twos) {
mimeType = MimeTypes.AUDIO_RAW;
pcmEncoding = C.ENCODING_PCM_16BIT_BIG_ENDIAN;
} else if (atomType == Atom.TYPE__mp3) {
} else if (atomType == Atom.TYPE__mp2 || atomType == Atom.TYPE__mp3) {
mimeType = MimeTypes.AUDIO_MPEG;
} else if (atomType == Atom.TYPE_alac) {
mimeType = MimeTypes.AUDIO_ALAC;
Expand Down

0 comments on commit 851ca20

Please sign in to comment.