Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92df9954 authored by Santosh Madhava's avatar Santosh Madhava Committed by Android (Google) Code Review
Browse files

Merge "Fix for issue 3485010: The project thumbnail is not regenerated"

parents ffbe8268 89782f50
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -928,6 +928,7 @@ public class VideoEditorImpl implements VideoEditor {
            String name;
            MediaItem currentMediaItem = null;
            Overlay currentOverlay = null;
            boolean regenerateProjectThumbnail = false;
            while (eventType != XmlPullParser.END_DOCUMENT) {
                switch (eventType) {
                    case XmlPullParser.START_TAG: {
@@ -948,6 +949,11 @@ public class VideoEditorImpl implements VideoEditor {
                            } catch (Exception ex) {
                                Log.w(TAG, "Cannot load media item: " + mediaItemId, ex);
                                currentMediaItem = null;

                                // First media item is invalid, mark for project thumbnail removal
                                if (mMediaItems.size() == 0) {
                                    regenerateProjectThumbnail = true;
                                }
                                // Ignore the media item
                                ignoredMediaItems.add(mediaItemId);
                            }
@@ -1043,6 +1049,11 @@ public class VideoEditorImpl implements VideoEditor {
                eventType = parser.next();
            }
            computeTimelineDuration();
            // Regenerate project thumbnail
            if (regenerateProjectThumbnail) {
                generateProjectThumbnail();
                regenerateProjectThumbnail = false;
            }
        } finally {
            if (fis != null) {
                fis.close();