Commit 58ed0e26 authored by Ludovic Fauvet's avatar Ludovic Fauvet

ThumbnailerManager: don't crash if we're unable to get a libvlc instance

parent a3f775b6
......@@ -58,12 +58,6 @@ public class ThumbnailerManager implements Runnable {
private final String mPrefix;
public ThumbnailerManager(Context context, Display display) {
try {
mLibVlc = LibVLC.getInstance();
} catch (LibVlcException e) {
e.printStackTrace();
}
mContext = context;
DisplayMetrics metrics = new DisplayMetrics();
display.getMetrics(metrics);
......@@ -72,6 +66,16 @@ public class ThumbnailerManager implements Runnable {
}
public void start(VideoListFragment videoListFragment) {
if (mLibVlc == null) {
try {
mLibVlc = LibVLC.getInstance();
} catch (LibVlcException e) {
Log.e(TAG, "Can't obtain libvlc instance");
e.printStackTrace();
return;
}
}
isStopping = false;
if (mThread == null || mThread.getState() == State.TERMINATED) {
mVideoListFragment = videoListFragment;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment