diff options
Diffstat (limited to 'TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp')
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp index dfd21ba020e..bc7bfe20e15 100644 --- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp @@ -36,7 +36,7 @@ Command_Handler::Command_Handler (ACE_HANDLE command_handle) Command_Handler::~Command_Handler (void) { - // this->remove_handlers (); + this->remove_handlers (); if (ACE_OS::getpid () == CTRpid) ::remove_all_semaphores (); } @@ -462,6 +462,7 @@ Command_Handler::init_av (void) if (af[0] != 0) { + int result; if ((result =init_audio_channel(af)) > 0) return result; else if (result < 0) @@ -485,7 +486,7 @@ Command_Handler::init_av (void) if (vf[0] != 0) { ACE_DEBUG ((LM_DEBUG,"(%P|%t) Initializing video\n")); - if ((result = this->init_video_channel(vf)) > 0) + if (this->init_video_channel(vf) > 0) return result; else if (result < 0) { @@ -524,14 +525,6 @@ Command_Handler::init_av (void) set_speed(); if (videoSocket >= 0) this->wait_for_display (INIT); - CmdWrite(&tmp, 1); - if (videoSocket < 0) - { - tmp = CmdVPclearScreen; - CmdWrite(&tmp, 1); - } - cerr << "returning from init_av \n"; - return 0; } cerr << "returning from init_av \n"; return 0; @@ -605,10 +598,7 @@ Command_Handler::init_java_av (char *audio_ior, if (audio_file!= 0) { - int result; - if ((result = init_audio_channel(audio_file)) > 0) - return result; - else if (result < 0) + if (init_audio_channel(audio_file)) { audioSocket = -1; shared->totalSamples = 0; @@ -629,9 +619,7 @@ Command_Handler::init_java_av (char *audio_ior, if (video_file!= 0) { ACE_DEBUG ((LM_DEBUG,"(%P|%t) Initializing video\n")); - if ((result = this->init_video_channel(video_file)) > 0) - return result; - else if (result < 0) + if (this->init_video_channel(video_file)) { shared->totalFrames = 0; /* disable video channel */ videoSocket = -1; @@ -793,7 +781,7 @@ Command_Handler::init_audio_channel (char *audiofile) #endif } abuffer->ABprocess(this->audio_data_handle_); - // this->remove_handlers (); + this->remove_handlers (); // Before shutting down the orb remove all the handlers registered with it. ACE_DEBUG ((LM_DEBUG,"(%P|%t) Before shutdown")); this->orb_manager_.orb ()->shutdown (); @@ -815,7 +803,16 @@ Command_Handler::init_audio_channel (char *audiofile) int Command_Handler::remove_handlers (void) { + int result; + result = this->client_sig_handler_.remove_handler (); + + if (TAO_ORB_Core_instance ()->reactor ()->remove_handler (&this->notification_handler_, + ACE_Event_Handler::READ_MASK) < 0) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) remove_handler for notification handler failed\n"), + -1); return 0; + } void @@ -1064,7 +1061,7 @@ Command_Handler::init_video_channel (char *videofile) } else { - // this->remove_handlers (); + this->remove_handlers (); this->orb_manager_.orb ()->shutdown (); return 1; } @@ -1127,7 +1124,7 @@ Command_Handler::init_video_channel (char *videofile) } } ACE_OS::read (sp[0], buf, 1); /* read a garbage byte, to sync with VB */ - ACE_DEBUG ((LM_DEBUG,"(%P|%t) Command process read a garbage bytes\n")); + fprintf (stderr,"(%P|%t) Command process read a garbage bytes\n"); ::close(sp[0]); ACE_OS::free (buf); } @@ -2142,7 +2139,7 @@ Client_Sig_Handler::Client_Sig_Handler (Command_Handler *command_handler) Client_Sig_Handler::~Client_Sig_Handler (void) { TAO_ORB_Core_instance ()->reactor ()->remove_handler (this, - ACE_Event_Handler::NULL_MASK); + ACE_Event_Handler::NULL_MASK); TAO_ORB_Core_instance ()->reactor ()->remove_handler (this->sig_set); } @@ -2190,10 +2187,10 @@ Client_Sig_Handler::remove_handler (void) { if (TAO_ORB_Core_instance ()->reactor ()->remove_handler (this, ACE_Event_Handler::NULL_MASK) == -1) - ACE_DEBUG ((LM_DEBUG,"(%P)remove_handler failed for client_sig handler for null mask\n")); + ACE_DEBUG ((LM_DEBUG,"(%P)remove_handler failed for client_sig handler")); if (TAO_ORB_Core_instance ()->reactor ()->remove_handler (sig_set) == -1) - ACE_DEBUG ((LM_DEBUG,"(%P)remove_handler failed for client_sig handler for sig set\n")); + ACE_DEBUG ((LM_DEBUG,"(%P)remove_handler failed for client_sig handler")); return 0; } |