Skip to content

Commit fdd3241

Browse files
committed
mediacodec: Don't suggest calling getOutputFormat() immediately
Calling getOutputFormat() at this point currently crashes in native code. (After a fix to the native code, this gives an IllegalStateException instead.) Change-Id: Ia45c4820bb3d9ed435a0aeef1ff8c230524f2e1f
1 parent 13a3a87 commit fdd3241

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

media/java/android/media/MediaCodec.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* codec.start();
3434
* ByteBuffer[] inputBuffers = codec.getInputBuffers();
3535
* ByteBuffer[] outputBuffers = codec.getOutputBuffers();
36-
* MediaFormat format = codec.getOutputFormat();
3736
* for (;;) {
3837
* int inputBufferIndex = codec.dequeueInputBuffer(timeoutUs);
3938
* if (inputBufferIndex >= 0) {
@@ -51,7 +50,7 @@
5150
* outputBuffers = codec.getOutputBuffers();
5251
* } else if (outputBufferIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
5352
* // Subsequent data will conform to new format.
54-
* format = codec.getOutputFormat();
53+
* MediaFormat format = codec.getOutputFormat();
5554
* ...
5655
* }
5756
* }

0 commit comments

Comments
 (0)