Commit be304486 by aquilescanta Committed by Oliver Woodman

Fix HLS' mime type propagation

Issue:#3653

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182064250
parent a4114f59
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
### dev-v2 (not yet released) ### ### dev-v2 (not yet released) ###
* HLS: Fix mime type propagation
([#3653](https://github.com/google/ExoPlayer/issues/3653)).
* SimpleExoPlayerView: Automatically apply video rotation if * SimpleExoPlayerView: Automatically apply video rotation if
`SimpleExoPlayerView` is configured to use `TextureView` `SimpleExoPlayerView` is configured to use `TextureView`
([#91](https://github.com/google/ExoPlayer/issues/91)). ([#91](https://github.com/google/ExoPlayer/issues/91)).
......
...@@ -474,8 +474,15 @@ public final class Format implements Parcelable { ...@@ -474,8 +474,15 @@ public final class Format implements Parcelable {
drmInitData, metadata); drmInitData, metadata);
} }
public Format copyWithContainerInfo(String id, String codecs, int bitrate, int width, int height, public Format copyWithContainerInfo(
@C.SelectionFlags int selectionFlags, String language) { String id,
String sampleMimeType,
String codecs,
int bitrate,
int width,
int height,
@C.SelectionFlags int selectionFlags,
String language) {
return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, maxInputSize, width, return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, maxInputSize, width,
height, frameRate, rotationDegrees, pixelWidthHeightRatio, projectionData, stereoMode, height, frameRate, rotationDegrees, pixelWidthHeightRatio, projectionData, stereoMode,
colorInfo, channelCount, sampleRate, pcmEncoding, encoderDelay, encoderPadding, colorInfo, channelCount, sampleRate, pcmEncoding, encoderDelay, encoderPadding,
......
...@@ -882,8 +882,10 @@ import java.util.Arrays; ...@@ -882,8 +882,10 @@ import java.util.Arrays;
int bitrate = propagateBitrate ? playlistFormat.bitrate : Format.NO_VALUE; int bitrate = propagateBitrate ? playlistFormat.bitrate : Format.NO_VALUE;
int sampleTrackType = MimeTypes.getTrackType(sampleFormat.sampleMimeType); int sampleTrackType = MimeTypes.getTrackType(sampleFormat.sampleMimeType);
String codecs = Util.getCodecsOfType(playlistFormat.codecs, sampleTrackType); String codecs = Util.getCodecsOfType(playlistFormat.codecs, sampleTrackType);
String mimeType = MimeTypes.getMediaMimeType(codecs);
return sampleFormat.copyWithContainerInfo( return sampleFormat.copyWithContainerInfo(
playlistFormat.id, playlistFormat.id,
mimeType,
codecs, codecs,
bitrate, bitrate,
playlistFormat.width, playlistFormat.width,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment