Skip to content

Commit 84a32b8

Browse files
Catch CodecException
1 parent 3db652d commit 84a32b8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cameraview/src/main/java/com/otaliastudios/cameraview/video/encoding/VideoMediaEncoder.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ protected void onPrepare(@NonNull MediaEncoderEngine.Controller controller, long
8181
}
8282
mMediaCodec.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
8383
mSurface = mMediaCodec.createInputSurface();
84-
mMediaCodec.start();
84+
try {
85+
mMediaCodec.start();
86+
} catch (MediaCodec.CodecException e) {
87+
throw new RuntimeException(e);
88+
}
8589
}
8690

8791
@EncoderThread

0 commit comments

Comments
 (0)