remove g_source considering context
authorYounghwan Ahn <younghwan_.an@samsung.com>
Fri, 7 Jun 2013 04:32:46 +0000 (13:32 +0900)
committerYounghwan Ahn <younghwan_.an@samsung.com>
Fri, 7 Jun 2013 04:32:46 +0000 (13:32 +0900)
Change-Id: I06fdd5030431459e81984e2e8fdf25efdd6e3473

packaging/libmm-player.spec
src/mm_player_priv.c

index c68ad1d9e0d065b3809100564b94a274a08f5a5f..8aebc19d4a70cfcd26143bc2bc94bbef115b9ca2 100644 (file)
@@ -1,7 +1,7 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.2.20
-Release:    1
+Version:    0.2.21
+Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
 URL:        http://source.tizen.org
index e7904ccf173ee119e94d1f9ffa994de1da01487b..be905c8a2bfa6cf69d62e16fd25964571831b47d 100644 (file)
@@ -226,6 +226,7 @@ static int  __mmplayer_realize_streaming_ext(mm_player_t* player);
 static int __mmplayer_unrealize_streaming_ext(mm_player_t *player);
 static int __mmplayer_start_streaming_ext(mm_player_t *player);
 static int __mmplayer_destroy_streaming_ext(mm_player_t* player);
+static void __mmplayer_remove_g_source_from_context(guint source_id);
 
 
 /*===========================================================================================
@@ -4904,6 +4905,23 @@ INIT_ERROR:
        return MM_ERROR_PLAYER_INTERNAL;
 }
 
+void __mmplayer_remove_g_source_from_context(guint source_id)
+{
+       GMainContext *context = g_main_context_get_thread_default ();
+       GSource *source = NULL;
+
+       debug_fenter();
+
+       source = g_main_context_find_source_by_id (context, source_id);
+
+       if (source != NULL)
+       {
+               debug_log("context : %x, source : %x", context, source);
+               g_source_destroy(source);
+       }
+
+       debug_fleave();
+}
 
 static int
 __mmplayer_gst_destroy_pipeline(mm_player_t* player) // @
@@ -4961,7 +4979,7 @@ __mmplayer_gst_destroy_pipeline(mm_player_t* player) // @
 
                /* disconnecting bus watch */
                if ( player->bus_watcher )
-                       g_source_remove_by_user_data( player);
+                       __mmplayer_remove_g_source_from_context(player->bus_watcher);
                player->bus_watcher = 0;
 
                if ( mainbin )
@@ -6540,7 +6558,7 @@ _mmplayer_destroy(MMHandleType handle) // @
 
        if (player->lazy_pause_event_id)
        {
-               g_source_remove_by_user_data(player);
+               __mmplayer_remove_g_source_from_context(player->lazy_pause_event_id);
                player->lazy_pause_event_id = 0;
        }
 
@@ -9956,7 +9974,7 @@ __mmplayer_cancel_delayed_eos( mm_player_t* player )
 
        if ( player->eos_timer )
        {
-               g_source_remove_by_user_data(player);
+               __mmplayer_remove_g_source_from_context( player->eos_timer );
        }
 
        player->eos_timer = 0;