diff options
author | Robert Shih <robertshih@google.com> | 2015-05-01 00:31:22 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-01 00:31:24 +0000 |
commit | f12071222fcf7c762bb8d28800ae693ec58347f4 (patch) | |
tree | 7738d7a1950aa6bf39f761cc334e419318e31ffd | |
parent | bbfa9b23c6b569003fc9bf0d698e8d64666f36a7 (diff) | |
parent | 29767a8c341c62d53661e800620273502f162e83 (diff) | |
download | frameworks_base-f12071222fcf7c762bb8d28800ae693ec58347f4.zip frameworks_base-f12071222fcf7c762bb8d28800ae693ec58347f4.tar.gz frameworks_base-f12071222fcf7c762bb8d28800ae693ec58347f4.tar.bz2 |
Merge "MediaPlayer: provide mime type for all track types" into mnc-dev
-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); } } |