Commit d3ecbf75 by andrewlewis Committed by Oliver Woodman

Fix buffer size for renderers with TRACK_TYPE_NONE

This includes NoSampleRenderers.

PiperOrigin-RevId: 226323693
parent bad8ec59
...@@ -1481,11 +1481,12 @@ public final class Util { ...@@ -1481,11 +1481,12 @@ public final class Util {
} }
/** /**
* Maps a {@link C} {@code TRACK_TYPE_*} constant to the corresponding {@link C} * Maps a {@link C} {@code TRACK_TYPE_*} constant to the corresponding {@link C} {@code
* {@code DEFAULT_*_BUFFER_SIZE} constant. * DEFAULT_*_BUFFER_SIZE} constant.
* *
* @param trackType The track type. * @param trackType The track type.
* @return The corresponding default buffer size in bytes. * @return The corresponding default buffer size in bytes.
* @throws IllegalArgumentException If the track type is an unrecognized or custom track type.
*/ */
public static int getDefaultBufferSize(int trackType) { public static int getDefaultBufferSize(int trackType) {
switch (trackType) { switch (trackType) {
...@@ -1501,8 +1502,10 @@ public final class Util { ...@@ -1501,8 +1502,10 @@ public final class Util {
return C.DEFAULT_METADATA_BUFFER_SIZE; return C.DEFAULT_METADATA_BUFFER_SIZE;
case C.TRACK_TYPE_CAMERA_MOTION: case C.TRACK_TYPE_CAMERA_MOTION:
return C.DEFAULT_CAMERA_MOTION_BUFFER_SIZE; return C.DEFAULT_CAMERA_MOTION_BUFFER_SIZE;
case C.TRACK_TYPE_NONE:
return 0;
default: default:
throw new IllegalStateException(); throw new IllegalArgumentException();
} }
} }
......
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