[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-player-dev
Subject: [Player-dev] CR/CN-Client: Fixed HXPlayer shutdown and ABD save
From: Daniel Yek <dyek () real ! com>
Date: 2007-04-23 23:25:10
Message-ID: 6.2.1.2.2.20070423162410.0bc9ed60 () mailone ! real ! com
[Download RAW message or body]
Modified by: dyek@real.com
Date: 4/23/2007
Project: Helix Player
Synopsis: Fixed HXPlayer shutdown and ABD save problems.
Overview:
Reference count and shutdown problems caused players not to save
ABD (Automated Bandwidth Detection) data to file at shutdown.
This change makes sure that the HXPlayer GObject is unreferenced
properly and thus that Helix Client is shutting down properly,
by calling ClientPlayerClose().
I have to remove an hxclientkit assert when DetachWindow() failed
because the player window (HXxWindow, passed to Helix core during
SitesNeeded call) was already gone.
There might be a cleaner way to fix this without removing the
shutdown error assert, but I haven't had much luck with the shutdown
sequence so far.
Files Modified:
player/hxclientkit/src/CHXClientSite.cpp
player/common/gtk/hxplayer.cpp
player/app/gtk/mainapp.cpp
Image Size and Heap Use impact (Client -Only):
None.
Platforms and Profiles Affected:
Linux
Distribution Libraries Affected:
None.
Distribution library impact and planned action:
None.
Platforms and Profiles Build Verified:
Profile: helix_client_all_define
Platform: Fedora Core 5
Platforms and Profiles Functionality verified:
Profile: helix_client_all_define
Platform: Fedora Core 5
Branch: HEAD
Copyright assignment: I am a RealNetworks employee.
Index: CHXClientSite.cpp
===================================================================
RCS file: /cvsroot/player/hxclientkit/src/CHXClientSite.cpp,v
retrieving revision 1.11.6.1
diff -u -w -r1.11.6.1 CHXClientSite.cpp
--- CHXClientSite.cpp 5 Apr 2005 18:40:27 -0000 1.11.6.1
+++ CHXClientSite.cpp 23 Apr 2007 22:01:25 -0000
@@ -240,7 +240,8 @@
if ( spISiteWindowed.IsValid() )
{
result = spISiteWindowed->DetachWindow();
// XXXSEH: Should we call Destroy() instead?
- CHXASSERT( SUCCEEDED( result ) );
+ // Ignore shutdown error when the player
window was already destroyed.
+ //CHXASSERT( SUCCEEDED( result ) );
}
}
m_spISite.Clear();
Index: hxplayer.cpp
===================================================================
RCS file: /cvsroot/player/common/gtk/hxplayer.cpp,v
retrieving revision 1.54
diff -u -w -r1.54 hxplayer.cpp
--- hxplayer.cpp 29 Mar 2007 18:55:59 -0000 1.54
+++ hxplayer.cpp 23 Apr 2007 21:59:59 -0000
@@ -2194,16 +2194,17 @@
player = HX_PLAYER(object);
- g_signal_emit_by_name(HX_BASIC_PLAYBACK(player), "destroy");
+ HX_RELEASE(player->pPlaybackVelocity);
+ HX_RELEASE(player->pPlaybackVelocityResponse);
+
+ ClientPlayerClose(player->player);
+ player->player = NULL;
g_players_list = g_list_remove(g_players_list, player);
g_free(player->window);
player->window = NULL;
- HX_RELEASE(player->pPlaybackVelocity);
- HX_RELEASE(player->pPlaybackVelocityResponse);
-
if(player->title_observer)
{
g_object_unref(player->title_observer);
Index: mainapp.cpp
===================================================================
RCS file: /cvsroot/player/app/gtk/mainapp.cpp,v
retrieving revision 1.134
diff -u -w -r1.134 mainapp.cpp
--- mainapp.cpp 23 Apr 2007 08:50:51 -0000 1.134
+++ mainapp.cpp 23 Apr 2007 22:11:34 -0000
@@ -2091,9 +2091,10 @@
}
void
-hmw_quit(GtkWidget*)
+hmw_quit(GtkWidget *widget)
{
- gtk_main_quit();
+ HXMainWindow* window = hxwindow_get_from_widget(widget);
+ gtk_widget_destroy(window->window);
}
void
@@ -5436,13 +5437,6 @@
{
hx_basic_playback_stop(window->active_player);
}
- if (window->hxclient_player)
- {
- g_signal_emit_by_name(G_OBJECT(window->hxclient_player), "destroy");
- g_object_unref(G_OBJECT(window->hxclient_player)); // Match
hx_player_new().
- window->hxclient_player = NULL;
- }
-
#ifdef HELIX_FEATURE_RP_SIGN_IN
if(g_hx_main_app->sign_in_controller)
{
@@ -5452,27 +5446,34 @@
hxcommon_save_preferences(window);
- g_object_unref(window->recent_urls_list_store);
- window->recent_urls_list_store = NULL;
+ if(window->playlist_dialog)
+ {
+ hx_playlist_dialog_destroy(window->playlist_dialog);
+ }
- if(window->context_menu)
+ if(window->metadata_reader)
{
- hx_context_menu_destroy(window->context_menu);
+ g_object_unref(window->metadata_reader);
}
- if(window->now_playing)
+ if (window->hxclient_player)
{
- g_object_unref(window->now_playing);
+ g_signal_emit_by_name(G_OBJECT(window->hxclient_player), "destroy");
+ g_object_unref(G_OBJECT(window->hxclient_player)); // Match
hx_player_new().
+ window->hxclient_player = NULL;
}
- if(window->playlist_dialog)
+ g_object_unref(window->recent_urls_list_store);
+ window->recent_urls_list_store = NULL;
+
+ if(window->context_menu)
{
- hx_playlist_dialog_destroy(window->playlist_dialog);
+ hx_context_menu_destroy(window->context_menu);
}
- if(window->metadata_reader)
+ if(window->now_playing)
{
- g_object_unref(window->metadata_reader);
+ g_object_unref(window->now_playing);
}
g_free(window->drag_url);
--
Daniel Yek
_______________________________________________
Player-dev mailing list
Player-dev@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/player-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic