mirror of
https://github.com/samsonjs/media.git
synced 2026-04-04 11:05:47 +00:00
Fix updating rate with codec reuse while disabled
While disabled the renderer does not have non-null stream formats. This means that setting the operating rate could cause a NullPointerException if there was a codec for reuse. Check for being enabled/started before trying to set the operating rate. After the renderer is enabled it should receive a new input format which will update the operating rate as needed. PiperOrigin-RevId: 235494384
This commit is contained in:
parent
caeaa9574e
commit
f394697d4a
1 changed files with 3 additions and 1 deletions
|
|
@ -559,7 +559,9 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
|||
@Override
|
||||
public final void setOperatingRate(float operatingRate) throws ExoPlaybackException {
|
||||
rendererOperatingRate = operatingRate;
|
||||
if (codec != null && codecDrainAction != DRAIN_ACTION_REINITIALIZE) {
|
||||
if (codec != null
|
||||
&& codecDrainAction != DRAIN_ACTION_REINITIALIZE
|
||||
&& getState() != STATE_DISABLED) {
|
||||
updateCodecOperatingRate();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue