diff options
Diffstat (limited to 'media')
-rwxr-xr-x | media/java/android/media/videoeditor/VideoEditorImpl.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/media/java/android/media/videoeditor/VideoEditorImpl.java b/media/java/android/media/videoeditor/VideoEditorImpl.java index 2446c2f..0953050 100755 --- a/media/java/android/media/videoeditor/VideoEditorImpl.java +++ b/media/java/android/media/videoeditor/VideoEditorImpl.java @@ -1834,10 +1834,20 @@ public class VideoEditorImpl implements VideoEditor { String filename = mI.getFilename(); if (mI instanceof MediaVideoItem) { MediaMetadataRetriever retriever = new MediaMetadataRetriever(); - retriever.setDataSource(filename); - Bitmap bitmap = retriever.getFrameAtTime(); - retriever.release(); - retriever = null; + Bitmap bitmap = null; + try { + retriever.setDataSource(filename); + bitmap = retriever.getFrameAtTime(); + } catch (RuntimeException ex) { + // Ignore failures while cleaning up. + } finally { + try { + retriever.release(); + } catch (RuntimeException ex) { + // Ignore failures while cleaning up. + } + } + if (bitmap == null) { String msg = "Thumbnail extraction from " + filename + " failed"; |