Prevent video thumbnail creation from crashing the app.
This commit is contained in:
parent
ab3e0b87c6
commit
dc503e3406
1 changed files with 3 additions and 3 deletions
|
@ -76,7 +76,7 @@ final class VideoThumbnailsExtractor {
|
||||||
outputHeightRotated = outputHeight;
|
outputHeightRotated = outputHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.i(TAG, "video: " + width + "x" + height + " " + rotation);
|
Log.i(TAG, "video :" + width + "x" + height + " " + rotation);
|
||||||
Log.i(TAG, "output: " + outputWidthRotated + "x" + outputHeightRotated);
|
Log.i(TAG, "output: " + outputWidthRotated + "x" + outputHeightRotated);
|
||||||
|
|
||||||
outputSurface = new OutputSurface(outputWidthRotated, outputHeightRotated, true);
|
outputSurface = new OutputSurface(outputWidthRotated, outputHeightRotated, true);
|
||||||
|
@ -97,8 +97,8 @@ final class VideoThumbnailsExtractor {
|
||||||
|
|
||||||
doExtract(extractor, decoder, outputSurface, outputWidthRotated, outputHeightRotated, duration, thumbnailCount, callback);
|
doExtract(extractor, decoder, outputSurface, outputWidthRotated, outputHeightRotated, duration, thumbnailCount, callback);
|
||||||
}
|
}
|
||||||
} catch (IllegalArgumentException | IOException | TranscodingException | MediaCodec.CodecException e) {
|
} catch (Throwable t) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, t);
|
||||||
callback.failed();
|
callback.failed();
|
||||||
} finally {
|
} finally {
|
||||||
if (outputSurface != null) {
|
if (outputSurface != null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue