From f2e0953643dce81666c86d4e7ffb6b3dd1ffb16d Mon Sep 17 00:00:00 2001 From: Rakesh Kumar Date: Thu, 3 Mar 2022 19:33:21 +0530 Subject: [PATCH] Updated way to create a formatBuilder Change-Id: I2c8eb8d6ee28d8c044d71db042f3b186ea5762f3 --- .../media3/exoplayer/rtsp/reader/RtpVP8Reader.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpVP8Reader.java b/libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpVP8Reader.java index 3adbca1b73..d786037833 100644 --- a/libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpVP8Reader.java +++ b/libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpVP8Reader.java @@ -97,11 +97,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; data.setPosition(currPosition); if (width != payloadFormat.format.width || height != payloadFormat.format.height) { - Format.Builder formatBuilder = new Format.Builder(); - if (payloadFormat.format.bitrate > 0) { - formatBuilder.setAverageBitrate(payloadFormat.format.bitrate); - } - formatBuilder.setSampleMimeType(payloadFormat.format.sampleMimeType); + Format trackFormat = payloadFormat.format; + Format.Builder formatBuilder = trackFormat.buildUpon(); formatBuilder.setWidth(width).setHeight(height); trackOutput.format(formatBuilder.build()); }