emotion: correctly close pipeline on file close, plus minor fix.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 25 Jul 2011 09:10:44 +0000 (09:10 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 25 Jul 2011 09:10:44 +0000 (09:10 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/emotion@61675 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/gstreamer/emotion_gstreamer.c

index a67af9a..d98e039 100644 (file)
@@ -601,7 +601,7 @@ em_file_open(const char   *file,
 
         if (!(vis_name = emotion_visualization_element_name_get(ev->vis)))
           {
-             ERR("pb vis name %d\n", ev->vis);
+             WRN("pb vis name %d", ev->vis);
              goto finalize;
           }
 
@@ -673,6 +673,7 @@ em_file_open(const char   *file,
 
    start = ecore_time_get();
    em_audio_channel_volume_set(ev, ev->volume);
+   em_audio_channel_mute_set(ev, ev->audio_mute);
 
    _eos_timer_fct(ev);
    _emotion_open_done(ev->obj);
@@ -699,6 +700,13 @@ em_file_close(void *video)
         ev->eos_bus = NULL;
      }
 
+   if (ev->pipeline)
+     {
+        gst_element_set_state(ev->pipeline, GST_STATE_NULL);
+        gst_object_unref(ev->pipeline);
+        ev->pipeline = NULL;
+     }
+
    /* we clear the stream lists */
    EINA_LIST_FREE(ev->audio_streams, astream)
      free(astream);
@@ -911,7 +919,6 @@ em_vis_set(void *video,
 
    ev = (Emotion_Gstreamer_Video *)video;
 
-   if (ev->vis == vis) return;
    ev->vis = vis;
 }
 
@@ -1191,9 +1198,6 @@ em_audio_channel_mute_set(void *video,
 
    ev = (Emotion_Gstreamer_Video *)video;
 
-   if (ev->audio_mute == mute)
-     return;
-
    ev->audio_mute = mute;
 
    g_object_set(G_OBJECT(ev->pipeline), "mute", !!mute, NULL);
@@ -1628,7 +1632,7 @@ _eos_timer_fct(void *data)
               _emotion_seek_done(ev->obj);
               break;
            default:
-              ERR("bus say: %s [%i]\n",
+              ERR("bus say: %s [%i]",
                   GST_MESSAGE_SRC_NAME(msg),
                   GST_MESSAGE_TYPE(msg));
               break;