Hello community,

here is the log from the commit of package emotion-generic-players for 
openSUSE:Factory checked in at 2014-03-01 07:47:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/emotion-generic-players (Old)
 and      /work/SRC/openSUSE:Factory/.emotion-generic-players.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "emotion-generic-players"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/emotion-generic-players/emotion-generic-players.changes
  2014-02-15 08:02:45.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.emotion-generic-players.new/emotion-generic-players.changes
     2014-03-01 07:47:40.000000000 +0100
@@ -1,0 +2,7 @@
+Thu Feb 27 03:39:01 UTC 2014 - [email protected]
+
+- Updated to 1.9.0 with the rest of the efl release.
+  As the release notes don't meantion any new features 
+  this is just a bug fix and keeping versions in sync release
+
+-------------------------------------------------------------------

Old:
----
  emotion_generic_players-1.8.0.tar.bz2

New:
----
  emotion_generic_players-1.9.0.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ emotion-generic-players.spec ++++++
--- /var/tmp/diff_new_pack.Fok1AR/_old  2014-03-01 07:47:42.000000000 +0100
+++ /var/tmp/diff_new_pack.Fok1AR/_new  2014-03-01 07:47:42.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           emotion-generic-players
-Version:        1.8.0
+Version:        1.9.0
 Release:        0
 Summary:        Set of generic players for Emotion
 License:        BSD-2-Clause

++++++ emotion_generic_players-1.8.0.tar.bz2 -> 
emotion_generic_players-1.9.0.tar.bz2 ++++++
++++ 1707 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/emotion_generic_players-1.8.0/AUTHORS 
new/emotion_generic_players-1.9.0/AUTHORS
--- old/emotion_generic_players-1.8.0/AUTHORS   2013-03-02 00:32:33.000000000 
+0100
+++ new/emotion_generic_players-1.9.0/AUTHORS   2014-02-24 16:10:19.000000000 
+0100
@@ -6,4 +6,15 @@
 Pierre Le Magourou <[email protected]>
 Rafael Antognolli <[email protected]>
 Sohyun Kim <[email protected]>
-
+Carsten Haitzler (Rasterman) <[email protected]>
+Davide Andreoli <[email protected]>
+Gustavo Sverzut Barbieri <[email protected]>
+Stefan Schmidt <[email protected]>
+Bruno Dilly <[email protected]>
+ChunEon Park <[email protected]>
+Daniel Juyung Seo <[email protected]>
+Doug Newgard <[email protected]>
+Jerome Pinot <[email protected]>
+Mike Blumenkrantz <[email protected]>
+Sebastian Dransfeld <[email protected]>
+Vincent Torri <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/emotion_generic_players-1.8.0/COPYING 
new/emotion_generic_players-1.9.0/COPYING
--- old/emotion_generic_players-1.8.0/COPYING   2013-03-02 00:32:33.000000000 
+0100
+++ new/emotion_generic_players-1.9.0/COPYING   2014-02-18 10:35:48.000000000 
+0100
@@ -1,6 +1,6 @@
 Copyright notice for Emotion:
 
-Copyright (C) 2004-2011 Carsten Haitzler and various contributors (see AUTHORS)
+Copyright (C) 2004-2014 Carsten Haitzler and various contributors (see AUTHORS)
 
 All rights reserved.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/emotion_generic_players-1.8.0/ChangeLog 
new/emotion_generic_players-1.9.0/ChangeLog
--- old/emotion_generic_players-1.8.0/ChangeLog 2013-03-02 00:32:33.000000000 
+0100
+++ new/emotion_generic_players-1.9.0/ChangeLog 2014-02-19 13:52:07.000000000 
+0100
@@ -3,3 +3,10 @@
        * Created the project based on previous
        emotion/src/generic_players, as it was removed when Emotion was
        merged into EFL single-tree.
+
+
+OUT OF DATE NOTICE:
+-------------------
+With the start of the 1.9.x release cycle we now longer update the ChangeLog 
and rely on git log for
+this functionality. We keep however a NEWS files for a high level overview of 
changes in a new
+release which will be filled at the end of the release cycle.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/emotion_generic_players-1.8.0/NEWS new/emotion_generic_players-1.9.0/NEWS
--- old/emotion_generic_players-1.8.0/NEWS      2013-03-02 00:32:33.000000000 
+0100
+++ new/emotion_generic_players-1.9.0/NEWS      2014-02-24 17:03:55.000000000 
+0100
@@ -0,0 +1,27 @@
+Emotion Generic Players 1.9.0
+
+Changes since Emotion Generic Players 1.8.0:
+--------------------------------------------
+
+Improvements:
+
+   * Emotion VLC player: debug++
+   * Emotion VLC: cleanup: only changed function order in file.
+   * Simplify player version dir fallback to match efl 1.9 simplification 
changes
+   * Emotion_generic_players - commented out unused func.
+   * Emotion VLC: no more need to send the size twice.
+   * Emotion VLC: use Eina_Bool instead of int for bools.
+   * Emotion VLC: defer the resource free until the video is actually stopped.
+
+Fixes:
+
+   * Emotion VLC backend: fix pause/stop to work again.
+     The EM_CMD_STOP command do not have any parameter so it must be
+     handled in the first call of the pipe.
+   * Check for libvlc >= 2.0 as a minimum as we use 2.x funcs
+   * Emotion VLC: remove quite all the old hacks from loading stage which 
fixes the problem that
+     audio was audible on start
+   * Emotion VLC: fix the random-player-stop bug !!
+   * Emotion VLC: fix send position_change while paused.
+   * Emotion VLC: recreate the player when end reached.
+   * Emotion VLC: fix the volume/mute bug.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/emotion_generic_players-1.8.0/README 
new/emotion_generic_players-1.9.0/README
--- old/emotion_generic_players-1.8.0/README    2013-12-01 06:54:14.000000000 
+0100
+++ new/emotion_generic_players-1.9.0/README    2014-02-19 13:53:10.000000000 
+0100
@@ -1,4 +1,4 @@
-Emotion Generic Players 1.8.0
+Emotion Generic Players 1.9.0
 =============================
 
 ******************************************************************************
@@ -31,7 +31,7 @@
 REQUIREMENTS
 ------------
 
-  * vlc (libvlc)
+  * vlc (libvlc >= 2.0)
 
 
 COMPONENTS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/emotion_generic_players-1.8.0/config.h.in 
new/emotion_generic_players-1.9.0/config.h.in
--- old/emotion_generic_players-1.8.0/config.h.in       2013-12-01 
10:57:29.000000000 +0100
+++ new/emotion_generic_players-1.9.0/config.h.in       2014-02-24 
17:05:22.000000000 +0100
@@ -30,6 +30,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
 /* Name of package */
 #undef PACKAGE
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/emotion_generic_players-1.8.0/configure.ac 
new/emotion_generic_players-1.9.0/configure.ac
--- old/emotion_generic_players-1.8.0/configure.ac      2013-12-01 
10:54:36.000000000 +0100
+++ new/emotion_generic_players-1.9.0/configure.ac      2014-02-24 
17:01:46.000000000 +0100
@@ -1,13 +1,13 @@
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 m4_define([v_maj], [1])
-m4_define([v_min], [8])
+m4_define([v_min], [9])
 m4_define([v_mic], [0])
 dnl m4_define([v_rev], m4_esyscmd([(git rev-list --count HEAD 2>/dev/null || 
echo 0) | tr -d '\n']))
 ##--   When released, remove the dnl on the below line
 dnl m4_undefine([v_rev])
 ##--   When doing snapshots - change soname. remove dnl on below line
-dnl m4_define([relname], [dev])
+m4_define([relname], [dev])
 dnl m4_define([v_rel], [-release relname])
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
@@ -87,13 +87,13 @@
 
 MODULE_ARCH=`pkg-config --variable=module_arch emotion`
 if test -z "${MODULE_ARCH}"; then
-   EMOTION_VERSION=`pkg-config --modversion emotion | cut -d. -f1-3`
+   EMOTION_VERSION=`pkg-config --modversion emotion | cut -d. -f1-2`
    case "$host_os" in
       mingw32ce*)
-         MODULE_ARCH="$host_os-$host_cpu"
+         MODULE_ARCH="v"
       ;;
       *)
-         MODULE_ARCH="$host_os-$host_cpu-${EMOTION_VERSION}"
+         MODULE_ARCH="v-${EMOTION_VERSION}"
       ;;
    esac
 fi
@@ -110,7 +110,7 @@
 AC_SUBST(MODULE_ARCH)
 
 #### Players
-EMOTION_GENERIC_PLAYER([VLC], [yes], [libvlc >= 0.9 eina >= 1.1.99 ecore >= 
1.7.99])
+EMOTION_GENERIC_PLAYER([VLC], [yes], [libvlc >= 2.0 eina >= 1.1.99 ecore >= 
1.7.99])
 
 
 AC_CONFIG_FILES([
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/emotion_generic_players-1.8.0/src/vlc/emotion_generic_vlc.c 
new/emotion_generic_players-1.9.0/src/vlc/emotion_generic_vlc.c
--- old/emotion_generic_players-1.8.0/src/vlc/emotion_generic_vlc.c     
2013-11-29 11:09:53.000000000 +0100
+++ new/emotion_generic_players-1.9.0/src/vlc/emotion_generic_vlc.c     
2014-02-24 16:10:19.000000000 +0100
@@ -29,60 +29,54 @@
 #define WRN(...) EINA_LOG_DOM_WARN(_em_vlc_log_dom, __VA_ARGS__)
 #define CRIT(...) EINA_LOG_DOM_CRIT(_em_vlc_log_dom, __VA_ARGS__)
 
-enum _Thread_Events {
-   EM_THREAD_POSITION_CHANGED,
-   EM_THREAD_PLAYBACK_STARTED,
-   EM_THREAD_PLAYBACK_STOPPED,
-   EM_THREAD_LAST
-};
 
 typedef struct _App App;
 struct _App {
    Emotion_Generic_Video_Shared *vs;
    Emotion_Generic_Video_Frame vf;
+
    libvlc_instance_t *libvlc;
    libvlc_media_t *m;
    libvlc_media_player_t *mp;
    libvlc_event_manager_t *event_mgr;
-   libvlc_event_manager_t *mevent_mgr;
+
+   Ecore_Pipe *fd_read;  // read commands from emotion here
+   Ecore_Pipe *fd_write; // write commands for emotion here
+   Eina_Lock   cmd_mutex;// lock used to send just one command at a time
+   int last_order;       // current command received from emotion
+
    char *filename;
    char *subtitle_path;
    char *shmname;
-   void *tmpbuffer;
-   int w, h;
-   // Use Ecore infra for that instead
-   Ecore_Pipe *fd_read; // read commands from theads here
-   Ecore_Pipe *fd_write; // write commands from threads here
-   /* int em_read; // read commands from emotion here */
-   /* int em_write; // write commands to emotion here */
-   int size_sent;
-   int opening;
-   int closing;
-   int playing;
-
-   int last_order;
-
+   unsigned w, h;
+   int volume;
+   Eina_Bool audio_muted;
+
+   Eina_Bool opening;
+   Eina_Bool closing;
+   Eina_Bool playing;
    Eina_Bool inited;
 };
 
-Eina_Bool
-exit_func(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev 
EINA_UNUSED)
-{
-   ecore_main_loop_quit();
-   return EINA_TRUE;
-}
+static void _player_setup(App *app);
+
 
-#define SEND_CMD_PARAM(app, i)                          \
-  if ((app)->fd_write)                                  \
-    if (!ecore_pipe_write((app)->fd_write, &(i), sizeof((i)))) \
+/* Utilities to send commands back to emotion */
+#define SEND_CMD_PARAM(app, i)                                  \
+  if ((app)->fd_write)                                          \
+    if (!ecore_pipe_write((app)->fd_write, &(i), sizeof((i))))  \
       ecore_main_loop_quit();
 
 static void
 _send_cmd(App *app, int cmd)
 {
-   if (app->fd_write)
-     if (!ecore_pipe_write(app->fd_write, &cmd, sizeof(cmd)))
-       ecore_main_loop_quit();
+   if (!app->fd_write)
+     return;
+
+   eina_lock_take(&app->cmd_mutex); /* LOCK HERE */
+   
+   if (!ecore_pipe_write(app->fd_write, &cmd, sizeof(cmd)))
+     ecore_main_loop_quit();
 }
 
 static void
@@ -100,35 +94,45 @@
 }
 
 static void
+_send_cmd_finish(App *app)
+{
+   eina_lock_release(&app->cmd_mutex); /* UNLOCK HERE */
+}
+
+/* Commands sent to the emotion pipe */
+static void
 _send_file_closed(App *app)
 {
-   app->closing = 0;
-   emotion_generic_shm_free(app->vs);
    _send_cmd(app, EM_RESULT_FILE_CLOSE);
+   _send_cmd_finish(app);
 }
 
 static void
-_send_time_changed(struct _App *app, const struct libvlc_event_t *ev)
+_send_time_changed(App *app)
 {
-   float new_time = ev->u.media_player_time_changed.new_time;
+   float new_time;
 
-   new_time /= 1000;
    if (app->vs->frame_drop > 1)
      return;
+
+   new_time = libvlc_media_player_get_time(app->mp);
+   new_time /= 1000;
    _send_cmd(app, EM_RESULT_POSITION_CHANGED);
    SEND_CMD_PARAM(app, new_time);
+   _send_cmd_finish(app);
 }
 
 static void
-_send_resize(struct _App *app, int width, int height)
+_send_resize(App *app, int width, int height)
 {
    _send_cmd(app, EM_RESULT_FRAME_SIZE);
    SEND_CMD_PARAM(app, width);
    SEND_CMD_PARAM(app, height);
+   _send_cmd_finish(app);
 }
 
 static void
-_send_track_info(struct _App *app, int cmd, int current, int count, 
libvlc_track_description_t *desc)
+_send_track_info(App *app, int cmd, int current, int count, 
libvlc_track_description_t *desc)
 {
    _send_cmd(app, cmd);
    SEND_CMD_PARAM(app, current);
@@ -141,10 +145,11 @@
         _send_cmd_str(app, name);
         desc = desc->p_next;
      }
+   _send_cmd_finish(app);
 }
 
 static void
-_send_all_track_info(struct _App *app)
+_send_all_track_info(App *app)
 {
    int track_count, current;
    libvlc_track_description_t *desc;
@@ -172,7 +177,7 @@
 }
 
 static void
-_send_all_meta_info(struct _App *app)
+_send_all_meta_info(App *app)
 {
    const char *meta;
 
@@ -198,80 +203,69 @@
    _send_cmd_str(app, meta);
    meta = libvlc_media_get_meta(app->m, libvlc_meta_TrackNumber);
    _send_cmd_str(app, meta);
+
+   _send_cmd_finish(app);
 }
 
-static Eina_Bool
-_loaded_idler(void *data)
+static void
+_send_length_changed(App *app)
 {
-   App *app = data;
-
-   if (app->mp)
-     libvlc_media_player_stop(app->mp);
+   float length = libvlc_media_player_get_length(app->mp);
 
-   return EINA_FALSE;
+   length /= 1000;
+   _send_cmd(app, EM_RESULT_LENGTH_CHANGED);
+   SEND_CMD_PARAM(app, length);
+   _send_cmd_finish(app);
 }
 
 static void
-_position_changed(App *app)
+_send_seekable_changed(App *app, const struct libvlc_event_t *ev)
 {
-   int r;
-   unsigned int w, h;
-
-   if (!app->opening)
-     return;
-
-   /* sending size info only once */
-   r = libvlc_video_get_size(app->mp, 0, &w, &h);
-   if (r < 0)
-     {
-        w = 1;
-        h = 1;
-     }
-
-   if (w > 0 || h > 0)
-     {
-        _send_resize(app, w, h);
-        app->size_sent = 1;
-     }
-
-   /* sending audio track info */
-   _send_all_track_info(app);
-
-   /* sending meta info */
-   _send_all_meta_info(app);
+   int seekable = ev->u.media_player_seekable_changed.new_seekable;
 
-   ecore_idler_add(_loaded_idler, app);
+   _send_cmd(app, EM_RESULT_SEEKABLE_CHANGED);
+   SEND_CMD_PARAM(app, seekable);
+   _send_cmd_finish(app);
 }
 
 static void
-_send_length_changed(struct _App *app, const struct libvlc_event_t *ev)
+_send_playback_started(App *app)
 {
-   float length = ev->u.media_player_length_changed.new_length;
-   length /= 1000;
-
-   _send_cmd(app, EM_RESULT_LENGTH_CHANGED);
-   SEND_CMD_PARAM(app, length);
+   _send_cmd(app, EM_RESULT_PLAYBACK_STARTED);
+   _send_cmd_finish(app);
 }
 
 static void
-_send_seekable_changed(struct _App *app, const struct libvlc_event_t *ev)
+_send_playback_stopped(App *app)
 {
-   int seekable = ev->u.media_player_seekable_changed.new_seekable;
+   _send_cmd(app, EM_RESULT_PLAYBACK_STOPPED);
+   _send_cmd_finish(app);
+}
 
-   _send_cmd(app, EM_RESULT_SEEKABLE_CHANGED);
-   SEND_CMD_PARAM(app, seekable);
+static void
+_send_init(App *app)
+{
+   _send_cmd(app, EM_RESULT_INIT);
+   _send_cmd_finish(app);
 }
 
 static void
-_send_file_set(struct _App *app)
+_send_file_set(App *app)
 {
-   if (app->opening)
-      _send_cmd(app, EM_RESULT_FILE_SET);
+   _send_cmd(app, EM_RESULT_FILE_SET);
+   _send_cmd_finish(app);
+}
 
-   if (app->closing)
-     _send_file_closed(app);
+static void
+_send_file_set_done(App *app, int success)
+{
+   _send_cmd(app, EM_RESULT_FILE_SET_DONE);
+   SEND_CMD_PARAM(app, success);
+   _send_cmd_finish(app);
 }
 
+
+/* VLC events and callbacks */
 static void
 _event_cb(const struct libvlc_event_t *ev, void *data)
 {
@@ -281,113 +275,82 @@
    switch (ev->type)
    {
       case libvlc_MediaPlayerTimeChanged:
-         _send_time_changed(app, ev);
-         break;
-      case libvlc_MediaPlayerPositionChanged:
-         _position_changed(app);
+         // DBG("libvlc_MediaPlayerTimeChanged"); 
+         _send_time_changed(app);
          break;
       case libvlc_MediaPlayerLengthChanged:
-         _send_length_changed(app, ev);
+         DBG("libvlc_MediaPlayerLengthChanged");
+         _send_length_changed(app);
          break;
       case libvlc_MediaPlayerSeekableChanged:
+         DBG("libvlc_MediaPlayerSeekableChanged");
          _send_seekable_changed(app, ev);
          break;
       case libvlc_MediaPlayerPlaying:
-         _send_resize(app, app->w, app->h);
-         _send_cmd(app, EM_RESULT_PLAYBACK_STARTED);
+         DBG("libvlc_MediaPlayerPlaying");
+         libvlc_audio_set_volume(app->mp, app->volume);
+         libvlc_audio_set_mute(app->mp, app->audio_muted);
+         _send_playback_started(app);
          break;
       case libvlc_MediaPlayerStopped:
-         _send_file_set(app);
+         DBG("libvlc_MediaPlayerStopped");
+         _send_playback_stopped(app);
+         if (app->closing)
+           {
+              free(app->filename);
+              app->filename = NULL;
+              free(app->subtitle_path);
+              app->subtitle_path = NULL;
+              libvlc_media_release(app->m);
+              app->m = NULL;
+              libvlc_media_player_release(app->mp);
+              app->mp = NULL;
+              emotion_generic_shm_free(app->vs);
+              app->playing = EINA_FALSE;
+              app->closing = EINA_FALSE;
+              _send_file_closed(app);
+           }
          break;
       case libvlc_MediaPlayerEndReached:
-         app->playing = 0;
-         _send_cmd(app, EM_RESULT_PLAYBACK_STOPPED);
+         DBG("libvlc_MediaPlayerEndReached");
+         app->playing = EINA_FALSE;
+         /* vlc had released the media_playere here, we create a new one */
+         app->mp = libvlc_media_player_new_from_media(app->m);
+         _player_setup(app);
+         _send_playback_stopped(app);
          break;
    }
    ecore_thread_main_loop_end();
 }
 
-static void *
-_tmp_lock(void *data, void **pixels)
-{
-   App *app = data;
-   *pixels = app->tmpbuffer;
-   return NULL;
-}
-
-static void
-_tmp_unlock(void *data EINA_UNUSED, void *id EINA_UNUSED, void *const *pixels 
EINA_UNUSED)
-{
-}
-
-static void
-_tmp_display(void *data EINA_UNUSED, void *id EINA_UNUSED)
-{
-}
-
-static unsigned
-_tmp_format(void **opaque, char *chroma,
-            unsigned *width, unsigned *height,
-            unsigned *pitches, unsigned *lines)
-{
-   App *app = *opaque;
-
-   app->tmpbuffer = realloc(app->tmpbuffer,
-                            *width * *height * 4 * sizeof (char));
-   strcpy(chroma, "RV32");
-   pitches[0] = pitches[1] = pitches[2] = *width * 4;
-   lines[0] = lines[1] = lines[2] = *height;
-
-   _send_resize(app, *width, *height);
-   
-   return 1;
-}
-
 static void
-_tmp_play(void *data EINA_UNUSED,
-          const void *samples EINA_UNUSED, unsigned count EINA_UNUSED,
-          int64_t pts EINA_UNUSED)
+_tmp_playing_event_cb(const struct libvlc_event_t *ev, void *data)
 {
-}
+   App *app = data;
 
-static void
-_file_set(App *app)
-{
-   app->m = libvlc_media_new_path(app->libvlc, app->filename);
-   if (!app->m)
-     {
-        ERR("could not open path: \"%s\"", app->filename);
-        return;
-     }
+   if (ev->type != libvlc_MediaPlayerPlaying)
+      return;
 
-   app->mp = libvlc_media_player_new_from_media(app->m);
-   if (!app->mp)
-     {
-        ERR("could not create new player from media.");
-        return;
-     }
+   /* pause and stop listening the temporary event */
+   libvlc_event_detach(app->event_mgr,libvlc_MediaPlayerPlaying,
+                       _tmp_playing_event_cb, app);
+   libvlc_media_player_set_pause(app->mp, 1);
+
+   /* sending size info */
+   libvlc_video_get_size(app->mp, 0, &app->w, &app->h);
+   _send_resize(app, app->w, app->h);
 
-   app->opening = 1;
-   libvlc_video_set_format(app->mp, "RV32", DEFAULTWIDTH, DEFAULTHEIGHT, 
DEFAULTWIDTH * 4);
-   libvlc_video_set_callbacks(app->mp, _tmp_lock, _tmp_unlock, _tmp_display, 
app);
-   libvlc_video_set_format_callbacks(app->mp, _tmp_format, NULL);
-   /* On my system the mute below is not working and I can't find a way
-      to make it work, so the following set should help, but then it has
-      other side effect...
-   */
-   /* libvlc_audio_set_callbacks(app->mp, _tmp_play, NULL, NULL, NULL, NULL, 
app); */
+   /* sending total lenght */
+   _send_length_changed(app);
 
-   app->event_mgr = libvlc_media_player_event_manager(app->mp);
-   libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerPositionChanged,
-                       _event_cb, app);
-   libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerStopped,
-                       _event_cb, app);
+   /* sending audio track info */
+   _send_all_track_info(app);
 
-   app->mevent_mgr = libvlc_media_event_manager(app->m);
+   /* sending meta info */
+   _send_all_meta_info(app);
 
-   app->tmpbuffer = malloc(sizeof(char) * DEFAULTWIDTH * DEFAULTHEIGHT * 4);
-   libvlc_audio_set_mute(app->mp, 1);
-   libvlc_media_player_play(app->mp);
+   /* ok, we are done! Now let emotion create the shmem for us */
+   _send_file_set(app);
 }
 
 static void *
@@ -421,82 +384,108 @@
    app->vs->frame.player = app->vs->frame.next;
    app->vs->frame.next = app->vs->frame.last;
    if (!app->vs->frame_drop++)
-     _send_cmd(app, EM_RESULT_FRAME_NEW);
+     {
+        _send_cmd(app, EM_RESULT_FRAME_NEW);
+        _send_cmd_finish(app);
+     }
    eina_semaphore_release(&app->vs->lock, 1);
 }
 
 static void
-_file_set_done(App *app)
+_player_setup(App *app)
 {
-   int r;
-
-   app->opening = 0;
-
-   r = emotion_generic_shm_get(app->shmname, &app->vs, &app->vf);
-   if (!r)
-     {
-        free(app->filename);
-        libvlc_media_release(app->m);
-        libvlc_media_player_release(app->mp);
-        app->filename = NULL;
-        app->m = NULL;
-        app->mp = NULL;
-
-        _send_cmd(app, EM_RESULT_FILE_SET_DONE);
-        SEND_CMD_PARAM(app, r);
-     }
-   app->w = app->vs->width;
-   app->h = app->vs->height;
+   
    libvlc_video_set_format(app->mp, "RV32", app->w, app->h, app->w * 4);
    libvlc_video_set_callbacks(app->mp, _lock, _unlock, _display, app);
 
+   app->event_mgr = libvlc_media_player_event_manager(app->mp);
    libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerPlaying,
-                      _event_cb, app);
+                       _event_cb, app);
    libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerTimeChanged,
-                      _event_cb, app);
+                       _event_cb, app);
    libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerLengthChanged,
-                      _event_cb, app);
+                       _event_cb, app);
    libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerSeekableChanged,
-                      _event_cb, app);
+                       _event_cb, app);
    libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerEndReached,
                        _event_cb, app);
-
-   libvlc_audio_set_mute(app->mp, 0);
-
-   _send_cmd(app, EM_RESULT_FILE_SET_DONE);
-   SEND_CMD_PARAM(app, r);
+   libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerStopped,
+                       _event_cb, app);
 }
 
+/* Commands received from the emotion pipe */
 static void
-_file_close(App *app)
+_file_set(App *app)
 {
-   app->playing = 0;
-   if (app->opening)
-     goto release_resources;
+   DBG("Path: %s", app->filename);
+   app->m = libvlc_media_new_path(app->libvlc, app->filename);
+   if (!app->m)
+     {
+        ERR("could not open path: \"%s\"", app->filename);
+        return;
+     }
 
-   if (libvlc_media_player_get_state(app->mp) != libvlc_Playing)
+   app->mp = libvlc_media_player_new_from_media(app->m);
+   if (!app->mp)
      {
-        _send_file_closed(app);
+        ERR("could not create new player from media.");
         return;
      }
 
-   app->closing = 1;
+   app->opening = EINA_TRUE;
 
-release_resources:
-   libvlc_media_player_stop(app->mp);
-   if (app->filename)
-     free(app->filename);
-   if (app->mp)
+   /* Here we start playing and connect a temporary callback to know when
+    * the file is parsed and ready to be played for real.
+    */
+   app->event_mgr = libvlc_media_player_event_manager(app->mp);
+   libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerPlaying,
+                       _tmp_playing_event_cb, app);
+
+   libvlc_media_player_play(app->mp);
+}
+
+static void
+_file_set_done(App *app)
+{
+   int r;
+
+   DBG("Path: %s", app->filename);
+   app->opening = EINA_FALSE;
+
+   r = emotion_generic_shm_get(app->shmname, &app->vs, &app->vf);
+   if (!r)
      {
+        free(app->filename);
         libvlc_media_release(app->m);
         libvlc_media_player_release(app->mp);
-        free(app->tmpbuffer);
+        app->filename = NULL;
+        app->m = NULL;
+        app->mp = NULL;
+     }
+   else
+     {
+        _player_setup(app);
      }
+
+   _send_file_set_done(app, r);
+}
+
+static void
+_file_close(App *app)
+{
+   DBG("closing file");
+
+   if (!app->mp)
+     return;
+
+   app->closing = EINA_TRUE;
+   libvlc_media_player_stop(app->mp);
 }
 
 static void
 _stop(App *app)
 {
+   DBG("Stop");
    if (app->mp)
      libvlc_media_player_set_pause(app->mp, 1);
 }
@@ -504,6 +493,8 @@
 static void
 _play(App *app, float pos)
 {
+   DBG("Play at %.3f", pos);
+
    if (!app->mp)
      return;
 
@@ -520,25 +511,30 @@
         if (app->subtitle_path)
           libvlc_video_set_subtitle_file(app->mp, app->subtitle_path);
 
-        app->playing = 1;
+        app->playing = EINA_TRUE;
      }
 }
 
 static void
-_position_set(struct _App *app, float position)
+_position_set(App *app, float position)
 {
    libvlc_time_t new_time;
 
+   DBG("Position set %.3f", position);
    if (!app->mp)
      return;
 
    new_time = position * 1000;
    libvlc_media_player_set_time(app->mp, new_time);
+
+   if (libvlc_media_player_get_state(app->mp) == libvlc_Paused)
+      _send_time_changed(app);
 }
 
 static void
 _speed_set(App *app, float rate)
 {
+   DBG("Speed set %.3f", rate);
    if (!app->mp)
      return;
 
@@ -548,40 +544,43 @@
 static void
 _mute_set(App *app, int mute)
 {
+   DBG("Mute %d", mute);
    if (!app->mp)
      return;
 
+   app->audio_muted = mute;
    libvlc_audio_set_mute(app->mp, mute);
 }
 
 static void
 _volume_set(App *app, float volume)
 {
-   int vol;
-
+   DBG("Volume set %.2f", volume);
    if (!app->mp)
      return;
 
-   vol = volume * 100;
-
-   libvlc_audio_set_volume(app->mp, vol);
+   app->volume = volume * 100;
+   libvlc_audio_set_volume(app->mp, app->volume);
 }
 
 static void
 _spu_track_set(App *app, int track)
 {
+   DBG("SPU track %d", track);
    libvlc_video_set_spu(app->mp, track);
 }
 
 static void
 _audio_track_set(App *app, int track)
 {
+   DBG("Audio track %d", track);
    libvlc_audio_set_track(app->mp, track);
 }
 
 static void
 _video_track_set(App *app, int track)
 {
+   DBG("Video Track %d", track);
    libvlc_video_set_track(app->mp, track);
 }
 
@@ -623,7 +622,7 @@
                    libvlc_media_release(app->m);
                    libvlc_media_player_release(app->mp);
                    free(app->filename);
-                   app->opening = 0;
+                   app->opening = EINA_FALSE;
                 }
               break;
            case EM_CMD_FILE_SET_DONE:
@@ -634,6 +633,10 @@
               _file_close(app);
               app->last_order = EM_CMD_LAST;
               break;
+           case EM_CMD_STOP:
+              _stop(app);
+              app->last_order = EM_CMD_LAST;
+              break;
           }
      }
    else
@@ -643,7 +646,7 @@
            case EM_CMD_INIT:
               app->shmname = strdup(buffer);
               app->inited = EINA_TRUE;
-              _send_cmd(app, EM_RESULT_INIT);
+              _send_init(app);
               break;
            case EM_CMD_FILE_SET:
               app->filename = strdup(buffer);
@@ -655,9 +658,6 @@
            case EM_CMD_PLAY:
               _play(app, *(float*) buffer);
               break;
-           case EM_CMD_STOP:
-              _stop(app);
-              break;
            case EM_CMD_POSITION_SET:
               _position_set(app, *(float*) buffer);
               break;
@@ -684,11 +684,20 @@
      }
 }
 
-void
+static void
 _dummy(void *data EINA_UNUSED, void *buffer EINA_UNUSED, unsigned int nbyte 
EINA_UNUSED)
 {
-   /* This function is useless for the pipe we use to send message back to 
emotion,
-      but still needed */
+   /* This function is useless for the pipe we use to send message back
+      to emotion, but still needed */
+}
+
+/* Main */
+Eina_Bool
+exit_func(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev 
EINA_UNUSED)
+{
+   DBG("Quit signal received !");
+   ecore_main_loop_quit();
+   return EINA_TRUE;
 }
 
 int
@@ -737,6 +746,8 @@
 
    ecore_init();
 
+   eina_lock_new(&app.cmd_mutex);
+   
    app.fd_read = ecore_pipe_full_add(_remote_command, &app,
                                      atoi(argv[1]), -1, EINA_FALSE, 
EINA_FALSE);
    app.fd_write = ecore_pipe_full_add(_dummy, NULL,
@@ -750,22 +761,21 @@
    app.subtitle_path = NULL;
    app.w = 0;
    app.h = 0;
-   app.size_sent = 0;
-   app.opening = 0;
-   app.playing = 0;
-   app.closing = 0;
-   app.last_order = EM_CMD_LAST;
+   app.opening = EINA_FALSE;
+   app.playing = EINA_FALSE;
    app.inited = EINA_FALSE;
+   app.last_order = EM_CMD_LAST;
 
    ecore_main_loop_begin();
 
    libvlc_release(app.libvlc);
-
+   ecore_pipe_del(app.fd_read);
+   ecore_pipe_del(app.fd_write);
    ecore_event_handler_del(hld);
+   eina_lock_free(&app.cmd_mutex);
 
    ecore_shutdown();
    eina_shutdown();
-
    return 0;
 
  error:

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to