mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Ensure DRAIN_ACTION_FLUSH_AND_UPDATE_DRM_SESSION is always executed
`codecDrainAction` is set to `DRAIN_ACTION_NONE` in 3 places in
`MediaCodecRenderer`:
* The constructor (so there's no prior state to worry about)
* `updateDrmSessionV23()`: Where `mediaCrypto` is reconfigured based
on `sourceDrmSession` and `codecDrmSession` is also updated to
`sourceDrmSession`.
* `resetCodecStateForFlush()`: Where (before this change) the action
is unconditionally set back to `DRAIN_ACTION_NONE` and so any
required updated implied by
`DRAIN_ACTION_FLUSH_AND_UPDATE_DRM_SESSION` is not done.
This change ensures that `flushOrReleaseCodec()` handles
`DRAIN_ACTION_FLUSH_AND_UPDATE_DRM_SESSION` before calling .
This probably also resolves Issue: google/ExoPlayer#10274
#minor-release
PiperOrigin-RevId: 454114428
(cherry picked from commit 222faa96d0)
This commit is contained in:
parent
0fd24c2fa3
commit
f6b987d8ec
2 changed files with 17 additions and 0 deletions
|
|
@ -69,6 +69,10 @@
|
|||
for audio passthrough when the format audio channel count is unset,
|
||||
which occurs with HLS chunkless preparation
|
||||
([10204](https://github.com/google/ExoPlayer/issues/10204)).
|
||||
* DRM
|
||||
* Ensure the DRM session is always correctly updated when seeking
|
||||
immediately after a format change
|
||||
([10274](https://github.com/google/ExoPlayer/issues/10274)).
|
||||
* Ad playback / IMA:
|
||||
* Decrease ad polling rate from every 100ms to every 200ms, to line up
|
||||
with Media Rating Council (MRC) recommendations.
|
||||
|
|
|
|||
|
|
@ -856,6 +856,19 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
|||
releaseCodec();
|
||||
return true;
|
||||
}
|
||||
if (codecDrainAction == DRAIN_ACTION_FLUSH_AND_UPDATE_DRM_SESSION) {
|
||||
checkState(Util.SDK_INT >= 23); // Implied by DRAIN_ACTION_FLUSH_AND_UPDATE_DRM_SESSION
|
||||
// Needed to keep lint happy (it doesn't understand the checkState call alone)
|
||||
if (Util.SDK_INT >= 23) {
|
||||
try {
|
||||
updateDrmSessionV23();
|
||||
} catch (ExoPlaybackException e) {
|
||||
Log.w(TAG, "Failed to update the DRM session, releasing the codec instead.", e);
|
||||
releaseCodec();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
flushCodec();
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue