~ubuntu-branches/ubuntu/natty/vlc/natty

« back to all changes in this revision

Viewing changes to modules/audio_output/pulse.c

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2010-07-23 10:41:59 UTC
  • mfrom: (1.1.31 upstream)
  • Revision ID: james.westby@ubuntu.com-20100723104159-pudrtu70a1svhiyl
Tags: 1.1.1-1+exp1ubuntu1
* Merge from Debian experimental, remaining changes:
  - build and install the libx264 plugin
  - add Xb-Npp header to vlc package
  - Add apport hook to include more vlc dependencies in bug reports

Show diffs side-by-side

added added

removed removed

Lines of Context:
315
315
{
316
316
    struct aout_sys_t * p_sys = (struct aout_sys_t *) p_aout->output.p_sys;
317
317
 
318
 
    pa_operation *o;
319
 
 
320
318
    if(!p_sys->started){
321
319
        msg_Dbg(p_aout, "Pulse stream started");
 
320
        pa_threaded_mainloop_lock(p_sys->mainloop);
322
321
        p_sys->start_date =
323
322
            aout_FifoFirstDate( p_aout, &p_aout->output.fifo );
324
323
        p_sys->started = 1;
325
324
 
326
 
        pa_threaded_mainloop_lock(p_sys->mainloop);
327
 
        if((o = pa_stream_flush(p_sys->stream, success_cb, p_aout))){
328
 
            pa_operation_unref(o);
329
 
        }
330
 
        pa_threaded_mainloop_unlock(p_sys->mainloop);
331
 
 
332
325
        pa_threaded_mainloop_signal(p_sys->mainloop, 0);
 
326
        pa_threaded_mainloop_unlock(p_sys->mainloop);
333
327
    }
334
328
}
335
329
 
347
341
        pa_threaded_mainloop_lock(p_sys->mainloop);
348
342
        pa_stream_set_write_callback(p_sys->stream, NULL, NULL);
349
343
 
350
 
/* I didn't find any explanation why we need to do pa_stream_drain on close
351
 
 * as we don't really care if we lose 20ms buffer in this point anyway?
352
 
 * And disabling this speeds up closing pulseaudio quite a lot (atleast for me).
353
 
 */
354
 
#if 0
355
 
        pa_operation *o = pa_stream_drain(p_sys->stream, success_cb, p_aout);
356
 
        if(o){
357
 
            while (pa_operation_get_state(o) != PA_OPERATION_DONE) {
358
 
                CHECK_DEAD_GOTO(fail);
359
 
                pa_threaded_mainloop_wait(p_sys->mainloop);
360
 
            }
361
 
 
362
 
        fail:
363
 
 
364
 
            pa_operation_unref(o);
365
 
        }
366
 
#endif
 
344
        pa_operation *o;
 
345
 
 
346
        o = pa_stream_flush(p_sys->stream, success_cb, p_aout);
 
347
        while( pa_operation_get_state(o) == PA_OPERATION_RUNNING )
 
348
            pa_threaded_mainloop_wait(p_sys->mainloop);
 
349
        pa_operation_unref(o);
 
350
 
 
351
        o = pa_stream_drain(p_sys->stream, success_cb, p_aout);
 
352
        while( pa_operation_get_state(o) == PA_OPERATION_RUNNING )
 
353
            pa_threaded_mainloop_wait(p_sys->mainloop);
 
354
        pa_operation_unref(o);
 
355
 
367
356
        pa_threaded_mainloop_unlock(p_sys->mainloop);
368
357
    }
369
358
    uninit(p_aout);