VirtualBox

Ignore:
Timestamp:
Feb 25, 2010 11:42:27 AM (15 years ago)
Author:
vboxsync
Message:

pulse: fixed regression with temporarily freezing guests if the guest pauses the AC97 controller

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/pulseaudio.c

    r25768 r26783  
    475475    {
    476476        case VOICE_ENABLE:
     477            /* Start audio output. */
    477478            pa_threaded_mainloop_lock(g_pMainLoop);
    478             pulse_wait_for_operation(pa_stream_cork(pPulse->pStream, 0, stream_success_callback, pPulse));
     479            pulse_wait_for_operation(pa_stream_cork(pPulse->pStream, 0,
     480                                                    stream_success_callback, pPulse));
    479481            pa_threaded_mainloop_unlock(g_pMainLoop);
    480482            break;
    481483
    482484        case VOICE_DISABLE:
     485            /* Pause audio output. Note that we must return immediately from here
     486             * so waiting until the buffers are flushed (trigger+drain) is not an
     487             * option! It could be sufficient to cork the audio stream (we are
     488             * called if the Pause bit of the AC97 x_CR register is set) but ALSA
     489             * uses snd_pcm_drop() dropping all pending frames so we do the same
     490             * here. */
    483491            pa_threaded_mainloop_lock(g_pMainLoop);
    484             pulse_wait_for_operation(pa_stream_trigger(pPulse->pStream, stream_success_callback, pPulse));
    485             pulse_wait_for_operation(pa_stream_drain(pPulse->pStream, stream_success_callback, pPulse));
    486             pulse_wait_for_operation(pa_stream_cork(pPulse->pStream, 1, stream_success_callback, pPulse));
     492            pulse_wait_for_operation(pa_stream_flush(pPulse->pStream,
     493                                                     stream_success_callback, pPulse));
     494            pulse_wait_for_operation(pa_stream_cork(pPulse->pStream, 1,
     495                                                    stream_success_callback, pPulse));
    487496            pa_threaded_mainloop_unlock(g_pMainLoop);
    488497            break;
     
    644653        case VOICE_ENABLE:
    645654            pa_threaded_mainloop_lock(g_pMainLoop);
    646             pulse_wait_for_operation(pa_stream_cork(pPulse->pStream, 0, stream_success_callback, pPulse));
     655            pulse_wait_for_operation(pa_stream_cork(pPulse->pStream, 0,
     656                                                    stream_success_callback, pPulse));
    647657            pa_threaded_mainloop_unlock(g_pMainLoop);
    648658            break;
     
    655665                pPulse->pu8PeekBuf = NULL;
    656666            }
    657             pulse_wait_for_operation(pa_stream_cork(pPulse->pStream, 1, stream_success_callback, pPulse));
     667            pulse_wait_for_operation(pa_stream_cork(pPulse->pStream, 1,
     668                                                    stream_success_callback, pPulse));
    658669            pa_threaded_mainloop_unlock(g_pMainLoop);
    659670            break;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette