]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't hang channels (MODENDP-106)
authorMichael Jerris <mike@jerris.com>
Wed, 16 Apr 2008 21:43:51 +0000 (21:43 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 16 Apr 2008 21:43:51 +0000 (21:43 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8121 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_portaudio/mod_portaudio.c

index 92fa81dab5a847d7f16b7db09ac700d38e5cc426..5f0fd644a271140c874aa10c11788d7bee362c3e 100644 (file)
@@ -539,13 +539,12 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
                return SWITCH_STATUS_SUCCESS;
        }
 
-       switch_mutex_lock(globals.device_lock);
  get_samples:
+       switch_mutex_lock(globals.device_lock);
 
        if ((samples = ReadAudioStream(globals.audio_stream, globals.read_frame.data, 
                                                                   globals.read_codec.implementation->samples_per_frame, 
                                                                   &globals.timer)) == 0) {
-               switch_mutex_unlock(globals.device_lock);
         switch_yield(1000);
         goto get_samples;
        } else {