diff options
author | Ivan Zderadicka <ivan.zderadicka@gmail.com> | 2010-05-13 14:41:08 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-05-13 14:43:28 +0200 |
commit | 41bba48ccbadeea109db53fe265481254afbf3de (patch) | |
tree | f1893331e87a198accd969a0c44277c04ed60719 /gst/festival | |
parent | d4f6a94b93291d36fd3658d790869f757187df05 (diff) |
festival: Don't open an infinite number of connections to the server and close connections
Fixes bug #618527.
Diffstat (limited to 'gst/festival')
-rw-r--r-- | gst/festival/gstfestival.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gst/festival/gstfestival.c b/gst/festival/gstfestival.c index de76a5826f..8c3509e47f 100644 --- a/gst/festival/gstfestival.c +++ b/gst/festival/gstfestival.c @@ -468,7 +468,7 @@ gst_festival_open (GstFestival * festival) ("Could not talk to festival server (no server running or wrong host/port?)"); return FALSE; } - + GST_OBJECT_FLAG_SET (festival, GST_FESTIVAL_OPEN); return TRUE; } @@ -480,7 +480,7 @@ gst_festival_close (GstFestival * festival) if (festival->info->server_fd != -1) close (festival->info->server_fd); - + GST_OBJECT_FLAG_UNSET (festival, GST_FESTIVAL_OPEN); return; } @@ -491,9 +491,11 @@ gst_festival_change_state (GstElement * element, GstStateChange transition) if (GST_STATE_PENDING (element) == GST_STATE_NULL) { if (GST_OBJECT_FLAG_IS_SET (element, GST_FESTIVAL_OPEN)) - gst_festival_close (GST_FESTIVAL (element)); + GST_DEBUG ("Closing connection "); + gst_festival_close (GST_FESTIVAL (element)); } else { if (!GST_OBJECT_FLAG_IS_SET (element, GST_FESTIVAL_OPEN)) { + GST_DEBUG ("Opening connection "); if (!gst_festival_open (GST_FESTIVAL (element))) return GST_STATE_CHANGE_FAILURE; } |