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

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

Merge "Fix for issue 3366265 : Native crash exporting movie" into honeycomb

parents 4fbca2b6 1abe0050
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();
        }
    }

    /*