Skip to content
Snippets Groups Projects
Commit 7c15f045 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Prevent an IllegalStateException when the MediaDiscoverer is already released

parent e42fa88b
No related branches found
No related tags found
1 merge request!1127Proper crash fix for the NullPointerException triggered by a race condition
Pipeline #148287 passed with stage
in 22 minutes and 38 seconds
......@@ -22,16 +22,17 @@ package org.videolan.libvlc.util;
import android.net.Uri;
import android.os.Handler;
import androidx.annotation.MainThread;
import android.util.Log;
import androidx.annotation.MainThread;
import org.videolan.libvlc.FactoryManager;
import org.videolan.libvlc.interfaces.IMediaFactory;
import org.videolan.libvlc.MediaDiscoverer;
import org.videolan.libvlc.MediaList;
import org.videolan.libvlc.interfaces.ILibVLC;
import org.videolan.libvlc.interfaces.IMedia;
import org.videolan.libvlc.MediaDiscoverer;
import org.videolan.libvlc.interfaces.IMediaFactory;
import org.videolan.libvlc.interfaces.IMediaList;
import org.videolan.libvlc.MediaList;
import java.util.ArrayList;
......@@ -154,7 +155,7 @@ public class MediaBrowser {
final MediaList ml = md.getMediaList();
ml.setEventListener(mDiscovererMediaListEventListener, mHandler);
ml.release();
md.start();
if (!md.isReleased()) md.start();
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment