[vlc-devel] [PATCH 1/2] Symbian specific inititialization routines
Rémi Denis-Courmont
remi at remlab.net
Mon Jan 24 21:37:36 CET 2011
diff --git a/src/symbian/specific.c b/src/symbian/specific.c
new file mode 100755
index 0000000..c0750a2
--- /dev/null
+++ b/src/symbian/specific.c
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * symbian.cpp: OS-specific initialization
+
*****************************************************************************
+ * Copyright © 2010 Pankaj Yadav
+ * Author: Pankaj Yadav
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301,
USA.
+
*****************************************************************************/
+#include "path.h"
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include "../libvlc.h"
+#include <pthread.h>
+#include <assert.h>
+
+void * ThreadController (void * );'
It beats me why you need a thread to manage the other ones. Even on WinCE we
did not need to do this
+static vlc_thread_t threadid;
+static int dead = 0;
+static int ret;
WTH is this a static variable??
+static void set_libvlc_path (void)
+{
+ char drive[11] = "C:\\sys\\bin";
+ const char * letter;
+
+ letter = GetConstPrivatePath();
+
+ drive[0] = *letter;
+ free ( letter );
+ psz_vlcpath = strdup ( drive );
+}
+
+static void unset_libvlc_path (void)
+{
+ free (psz_vlcpath);
+}
+
+void system_Init (libvlc_int_t *libvlc, int *argc, const char *argv[])
+{
+ ret = pthread_create(&threadid, NULL, ThreadController, &dead);
The callback function does not exist. It is customary to sort patches in
compilable order.
+ assert(ret==0);
+
+ set_libvlc_path();
+
+ VLC_UNUSED ( libvlc );
+ VLC_UNUSED ( argc );
+ VLC_UNUSED ( argv );
+}
+
+void system_Configure (libvlc_int_t *libvlc,
+ int argc, const char *const argv[])
+{
+ VLC_UNUSED ( libvlc );
+ VLC_UNUSED ( argc );
+ VLC_UNUSED ( argv );
+}
+
+void system_End (libvlc_int_t *libvlc)
+{
+ int ret;void * result;
+
+ dead = 1;
This statement has no effects within the boundary of the POSIX threads memory
model. See POSIX General Concepts section A.4.11 for further reference:
http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html
+ ret = pthread_join ( threadid,&result);
+ assert(ret==0);
+
+ unset_libvlc_path();
+
+ VLC_UNUSED ( libvlc );
+}
+
--
1.7.1
--
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis
More information about the vlc-devel
mailing list