diff options
author | Robert Shih <robertshih@google.com> | 2015-05-01 01:35:13 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-05-01 01:35:13 +0000 |
commit | 043b26ba9adc1f8415ab8f6aac9e71d9ca66f898 (patch) | |
tree | 71f26f80f0980ed3af52b7a491030fe7cc2a8627 /media | |
parent | af46061300c888aab94d1c1047f8fe3d8511ab93 (diff) | |
parent | 4816ebe8c2f312bca44d95abdfec0dba137c4fd4 (diff) | |
download | frameworks_base-043b26ba9adc1f8415ab8f6aac9e71d9ca66f898.zip frameworks_base-043b26ba9adc1f8415ab8f6aac9e71d9ca66f898.tar.gz frameworks_base-043b26ba9adc1f8415ab8f6aac9e71d9ca66f898.tar.bz2 |
am 4816ebe8: am e8a8440d: am f1207122: Merge "MediaPlayer: provide mime type for all track types" into mnc-dev
* commit '4816ebe8c2f312bca44d95abdfec0dba137c4fd4':
MediaPlayer: provide mime type for all track types
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/MediaPlayer.java | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java index a33fa59..77adb39 100644 --- a/media/java/android/media/MediaPlayer.java +++ b/media/java/android/media/MediaPlayer.java @@ -1953,21 +1953,16 @@ public class MediaPlayer implements SubtitleController.Listener TrackInfo(Parcel in) { mTrackType = in.readInt(); - // TODO: parcel in the full MediaFormat + // TODO: parcel in the full MediaFormat; currently we are using createSubtitleFormat + // even for audio/video tracks, meaning we only set the mime and language. + String mime = in.readString(); String language = in.readString(); + mFormat = MediaFormat.createSubtitleFormat(mime, language); - if (mTrackType == MEDIA_TRACK_TYPE_TIMEDTEXT) { - mFormat = MediaFormat.createSubtitleFormat( - MEDIA_MIMETYPE_TEXT_SUBRIP, language); - } else if (mTrackType == MEDIA_TRACK_TYPE_SUBTITLE) { - String mime = in.readString(); - mFormat = MediaFormat.createSubtitleFormat(mime, language); + if (mTrackType == MEDIA_TRACK_TYPE_SUBTITLE) { mFormat.setInteger(MediaFormat.KEY_IS_AUTOSELECT, in.readInt()); mFormat.setInteger(MediaFormat.KEY_IS_DEFAULT, in.readInt()); mFormat.setInteger(MediaFormat.KEY_IS_FORCED_SUBTITLE, in.readInt()); - } else { - mFormat = new MediaFormat(); - mFormat.setString(MediaFormat.KEY_LANGUAGE, language); } } |