From fc01020113bb76bc893228d46accdc1a0385bf3c Mon Sep 17 00:00:00 2001 From: Victoria Date: Sat, 22 Apr 2023 18:12:09 +0700 Subject: [PATCH] update java interfaces https://github.com/shahen94/react-native-video-processing/issues/371 --- .../com/shahenlibrary/Trimmer/Trimmer.java | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/android/src/main/java/com/shahenlibrary/Trimmer/Trimmer.java b/android/src/main/java/com/shahenlibrary/Trimmer/Trimmer.java index 8a07474a..66d89fee 100644 --- a/android/src/main/java/com/shahenlibrary/Trimmer/Trimmer.java +++ b/android/src/main/java/com/shahenlibrary/Trimmer/Trimmer.java @@ -304,7 +304,11 @@ public static void getPreviewImages(String path, Promise promise, ReactApplicati promise.resolve(event); } finally { - retriever.release(); + try { + retriever.release(); + } catch (Exception e) { + e.printStackTrace(); + } } } @@ -446,7 +450,11 @@ private static ReadableMap getVideoRequiredMetadata(String source, Context ctx) videoMetadata.putInt("bitrate", bitrate); return videoMetadata; } finally { - retriever.release(); + try { + retriever.release(); + } catch (Exception e) { + e.printStackTrace(); + } } } @@ -566,7 +574,11 @@ static void getPreviewImageAtPosition(String source, double sec, String format, // NOTE: FIX ROTATED BITMAP orientation = Integer.parseInt(metadataRetriever.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION)); } finally { - metadataRetriever.release(); + try { + metadataRetriever.release(); + } catch (Exception e) { + e.printStackTrace(); + } } if ( orientation != 0 ) { @@ -667,7 +679,11 @@ static void getTrimmerPreviewImages(String source, double startTime, double endT promise.resolve(event); } finally { - retriever.release(); + try { + retriever.release(); + } catch (Exception e) { + e.printStackTrace(); + } } }