mirror of
https://github.com/androidx/media.git
synced 2025-05-10 00:59:51 +08:00
Set HlsSampleStreamWrapper.trackType for audio-only playlists
For audio-only playlists, when formats are communicated to the app with AnalyticsListener.onDownstreamFormatChanged(), the passed MediaLoadData do not indicate this is an audio track and therefore the PlaybackStatsListener cannot derive audio format-related information. This change sets the main SampleStreamWrappers track type to AUDIO, if the master playlist contains only audio variants. Issue: #9175 #minor-release PiperOrigin-RevId: 388676060
This commit is contained in:
parent
5b2b882e81
commit
5689e093da
@ -144,6 +144,12 @@
|
|||||||
* Deprecate `setControlDispatcher` in `MediaSessionConnector`. The
|
* Deprecate `setControlDispatcher` in `MediaSessionConnector`. The
|
||||||
`ControlDispatcher` parameter has also been deprecated in all
|
`ControlDispatcher` parameter has also been deprecated in all
|
||||||
`MediaSessionConnector` listener methods.
|
`MediaSessionConnector` listener methods.
|
||||||
|
* HLS:
|
||||||
|
* Report audio track type in
|
||||||
|
`AnalyticsListener.onDownstreamFormatChanged()` for audio-only
|
||||||
|
playlists, so that the `PlaybackStatsListener` can derive audio
|
||||||
|
format-related information.
|
||||||
|
([#9175](https://github.com/google/ExoPlayer/issues/9175)).
|
||||||
|
|
||||||
### 2.14.2 (2021-07-20)
|
### 2.14.2 (2021-07-20)
|
||||||
|
|
||||||
|
@ -628,9 +628,13 @@ public final class HlsMediaPeriod
|
|||||||
numberOfAudioCodecs <= 1
|
numberOfAudioCodecs <= 1
|
||||||
&& numberOfVideoCodecs <= 1
|
&& numberOfVideoCodecs <= 1
|
||||||
&& numberOfAudioCodecs + numberOfVideoCodecs > 0;
|
&& numberOfAudioCodecs + numberOfVideoCodecs > 0;
|
||||||
|
int trackType =
|
||||||
|
!useVideoVariantsOnly && numberOfAudioCodecs > 0
|
||||||
|
? C.TRACK_TYPE_AUDIO
|
||||||
|
: C.TRACK_TYPE_DEFAULT;
|
||||||
HlsSampleStreamWrapper sampleStreamWrapper =
|
HlsSampleStreamWrapper sampleStreamWrapper =
|
||||||
buildSampleStreamWrapper(
|
buildSampleStreamWrapper(
|
||||||
C.TRACK_TYPE_DEFAULT,
|
trackType,
|
||||||
selectedPlaylistUrls,
|
selectedPlaylistUrls,
|
||||||
selectedPlaylistFormats,
|
selectedPlaylistFormats,
|
||||||
masterPlaylist.muxedAudioFormat,
|
masterPlaylist.muxedAudioFormat,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user