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

Commit 3cf1554b authored by Santosh Madhava's avatar Santosh Madhava Committed by Android Git Automerger
Browse files

am 7196a266: am b38ed1af: Merge "Fix for issue 3366265 : Native crash...

am 7196a266: am b38ed1af: Merge "Fix for issue 3366265 : Native crash exporting movie" into honeycomb

* commit '7196a266':
  Fix for issue 3366265 : Native crash exporting movie
parents 07937496 7196a266
Loading
Loading
Loading
Loading
+22 −3
Original line number Original line Diff line number Diff line
@@ -59,6 +59,11 @@ public class VideoEditorImpl implements VideoEditor {
     */
     */
    final Semaphore mPreviewSemaphore = new Semaphore(1, true);
    final Semaphore mPreviewSemaphore = new Semaphore(1, true);


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

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


        try {
            mExportSemaphore.acquire();
            mMANativeHelper.export(filename, mProjectPath, height,bitrate,audioCodec,
            mMANativeHelper.export(filename, mProjectPath, height,bitrate,audioCodec,
                videoCodec,mMediaItems, mTransitions, mAudioTracks,listener);
                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");
                throw new IllegalArgumentException("Argument Bitrate incorrect");
        }
        }


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


    /*
    /*