Commit a3324b58 authored by Edward Wang's avatar Edward Wang

Move length_change_monitor to top of file so that it can be used in the entire file

parent c0437e6d
......@@ -40,6 +40,21 @@
#define AOUT_AUDIOTRACK_JAVA 1
#define AOUT_OPENSLES 2
struct length_change_monitor {
pthread_mutex_t doneMutex;
pthread_cond_t doneCondVar;
bool length_changed;
};
static void length_changed_callback(const libvlc_event_t *ev, void *data)
{
struct length_change_monitor *monitor = data;
pthread_mutex_lock(&monitor->doneMutex);
monitor->length_changed = true;
pthread_cond_signal(&monitor->doneCondVar);
pthread_mutex_unlock(&monitor->doneMutex);
}
libvlc_media_t *new_media(jint instance, JNIEnv *env, jobject thiz, jstring fileLocation, bool noOmx, bool noVideo)
{
libvlc_instance_t *libvlc = (libvlc_instance_t*)instance;
......@@ -639,21 +654,6 @@ jobjectArray Java_org_videolan_vlc_LibVLC_readTracksInfo(JNIEnv *env, jobject th
return array;
}
struct length_change_monitor {
pthread_mutex_t doneMutex;
pthread_cond_t doneCondVar;
bool length_changed;
};
static void length_changed_callback(const libvlc_event_t *ev, void *data)
{
struct length_change_monitor *monitor = data;
pthread_mutex_lock(&monitor->doneMutex);
monitor->length_changed = true;
pthread_cond_signal(&monitor->doneCondVar);
pthread_mutex_unlock(&monitor->doneMutex);
}
jlong Java_org_videolan_vlc_LibVLC_getLengthFromLocation(JNIEnv *env, jobject thiz,
jint i_instance, jstring fileLocation)
{
......
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