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

Edward Wang git at videolan.org
Wed Jun 20 05:51:21 CEST 2012


android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Tue Jun 19 23:48:47 2012 -0400| [a3324b58fffcea1616121859dd8b6059e5ffb1cb] | committer: Edward Wang

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

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=a3324b58fffcea1616121859dd8b6059e5ffb1cb
---

 vlc-android/jni/libvlcjni.c |   30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index 7cefc52..c62d0c9 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -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)
 {



More information about the Android mailing list