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

Commit 1abe0050 authored by Santosh Madhava's avatar Santosh Madhava
Browse files

Fix for issue 3366265 : Native crash exporting movie

Change-Id: I04195198031eeb7d34d4249b49a1092321a2eb0a
parent 2aaa7764
Loading
Loading
Loading
Loading
+22 −3
Original line number Diff line number Diff line
@@ -59,6 +59,11 @@ public class VideoEditorImpl implements VideoEditor {
     */
    final Semaphore mPreviewSemaphore = new Semaphore(1, true);

    /*
     *  Semaphore to control export calls
     */
    final Semaphore mExportSemaphore = new Semaphore(1, true);

    /*
     *  XML tags
     */
@@ -401,8 +406,15 @@ public class VideoEditorImpl implements VideoEditor {
                throw new IllegalArgumentException("Argument Bitrate incorrect");
        }

        try {
            mExportSemaphore.acquire();
            mMANativeHelper.export(filename, mProjectPath, height,bitrate,audioCodec,
                videoCodec,mMediaItems, mTransitions, mAudioTracks,listener);
        } catch (InterruptedException  ex) {
            Log.e("VideoEditorImpl", "Sem acquire NOT successful in export");
        } finally {
            mExportSemaphore.release();
        }
    }

    /*
@@ -466,9 +478,16 @@ public class VideoEditorImpl implements VideoEditor {
                throw new IllegalArgumentException("Argument Bitrate incorrect");
        }

        try {
            mExportSemaphore.acquire();
            mMANativeHelper.export(filename, mProjectPath, height,bitrate,
                               mMediaItems, mTransitions, mAudioTracks,
                               listener);
        } catch (InterruptedException  ex) {
            Log.e("VideoEditorImpl", "Sem acquire NOT successful in export");
        } finally {
            mExportSemaphore.release();
        }
    }

    /*