kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add proper catch for ISE in video thumb extractor.
rodzic
6ec7834046
commit
28feba6a6c
|
@ -161,7 +161,14 @@ final class VideoThumbnailsExtractor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int outputBufIndex = decoder.dequeueOutputBuffer(info, TIMEOUT_USEC);
|
final int outputBufIndex;
|
||||||
|
try {
|
||||||
|
outputBufIndex = decoder.dequeueOutputBuffer(info, TIMEOUT_USEC);
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
Log.w(TAG, "Decoder not in the Executing state, or codec is configured in asynchronous mode.", e);
|
||||||
|
throw new TranscodingException("Decoder not in the Executing state, or codec is configured in asynchronous mode.", e);
|
||||||
|
}
|
||||||
|
|
||||||
if (outputBufIndex >= 0) {
|
if (outputBufIndex >= 0) {
|
||||||
if ((info.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
|
if ((info.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
|
||||||
outputDone = true;
|
outputDone = true;
|
||||||
|
|
|
@ -9,4 +9,8 @@ final class TranscodingException extends Exception {
|
||||||
TranscodingException(Throwable inner) {
|
TranscodingException(Throwable inner) {
|
||||||
super(inner);
|
super(inner);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TranscodingException(String message, Throwable inner) {
|
||||||
|
super(message, inner);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue