[Android] Release lock when thumbnailer is interrupted

Geoffrey Métais git at videolan.org
Wed Feb 18 11:13:04 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Feb 18 10:51:31 2015 +0100| [02359fe0504f28bda98298e74333959ab74eab60] | committer: Geoffrey Métais

Release lock when thumbnailer is interrupted

CID #1226337

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=02359fe0504f28bda98298e74333959ab74eab60
---

 vlc-android/src/org/videolan/vlc/Thumbnailer.java |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/Thumbnailer.java b/vlc-android/src/org/videolan/vlc/Thumbnailer.java
index 3f74da7..5b1c2fb 100644
--- a/vlc-android/src/org/videolan/vlc/Thumbnailer.java
+++ b/vlc-android/src/org/videolan/vlc/Thumbnailer.java
@@ -149,7 +149,6 @@ public class Thumbnailer implements Runnable {
                 mVideoBrowser.resetBarrier();
             lock.lock();
             // Get the id of the file browser item to create its thumbnail.
-            boolean interrupted = false;
             while (mItems.size() == 0) {
                 try {
                     if (mVideoBrowser != null) {
@@ -159,15 +158,11 @@ public class Thumbnailer implements Runnable {
                     totalCount = 0;
                     notEmpty.await();
                 } catch (InterruptedException e) {
-                    interrupted = true;
+                    lock.unlock();
                     Log.i(TAG, "interruption probably requested by stop()");
                     break;
                 }
             }
-            if (interrupted) {
-                lock.unlock();
-                break;
-            }
             total = totalCount;
             MediaWrapper item = mItems.poll();
             lock.unlock();



More information about the Android mailing list