~ubuntu-branches/ubuntu/quantal/indicator-sound/quantal

« back to all changes in this revision

Viewing changes to src/pulseaudio-mgr.c

  • Committer: Ken VanDine
  • Date: 2012-03-16 17:59:34 UTC
  • mfrom: (28.174.10)
  • mto: This revision was merged to the branch mainline in revision 110.
  • Revision ID: ken.vandine@canonical.com-20120316175934-90d5u1pg365513an
* New upstream release.
  - indicator-sound "Choose Playlist" menu item does nothing when using 
    Rhythmbox (LP: #952550)
  - crashed with SIGSEGV in g_strdup() (LP: #946607)
  - crashed with SIGABRT in pa_operation_unref() (LP: #944148)
  - crashed with signal 5 in g_type_create_instance() (LP: #921755)
  - slider on unmute resets volume (LP: #921065)
  - play controls not exposed in HUD (LP: #949032)
  - unity-panel-service at 100% cpu when opened /w rb without album 
    cover (LP: #806848)

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
  if (!operation){
219
219
    g_warning ("pm_update_mute operation failed for some reason");
220
220
    return;
221
 
  }  
 
221
  }
222
222
  pa_operation_unref (operation);
223
223
}
224
224
 
401
401
  case PA_CONTEXT_READY:
402
402
    connection_attempts = 0;
403
403
    g_debug("PA_CONTEXT_READY");
 
404
    
404
405
    if (reconnect_idle_id != 0){
405
406
      g_source_remove (reconnect_idle_id);
406
407
      reconnect_idle_id = 0;
407
408
    }
408
 
    pa_operation *o;
409
409
 
410
410
    pa_context_set_subscribe_callback(c, pm_subscribed_events_callback, userdata);
411
 
 
412
 
    if (!(o = pa_context_subscribe (c, (pa_subscription_mask_t)
413
 
                                   (PA_SUBSCRIPTION_MASK_SINK|
414
 
                                    PA_SUBSCRIPTION_MASK_SOURCE|
415
 
                                    PA_SUBSCRIPTION_MASK_SINK_INPUT|
416
 
                                    PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT|
417
 
                                    PA_SUBSCRIPTION_MASK_SERVER), NULL, NULL))) {
418
 
      g_warning("pa_context_subscribe() failed");
419
 
    
420
 
    }
421
 
 
422
 
    if (!(o = pa_context_get_server_info (c, pm_server_info_callback, userdata))) {
423
 
      g_warning("Initial - pa_context_get_server_info() failed");
424
 
    }
 
411
    pa_operation *o = NULL;
 
412
 
 
413
    o = pa_context_subscribe (c, (pa_subscription_mask_t)
 
414
                                 (PA_SUBSCRIPTION_MASK_SINK|
 
415
                                  PA_SUBSCRIPTION_MASK_SOURCE|
 
416
                                  PA_SUBSCRIPTION_MASK_SINK_INPUT|
 
417
                                  PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT|
 
418
                                  PA_SUBSCRIPTION_MASK_SERVER),
 
419
                                  NULL,
 
420
                                  NULL);
 
421
                                   
 
422
    
 
423
    if (!o){
 
424
      g_critical("pa_context_subscribe() failed - ?");
 
425
      return;
 
426
    }
 
427
 
 
428
    pa_operation_unref(o);
 
429
 
 
430
    o = pa_context_get_server_info (c, pm_server_info_callback, userdata);
 
431
 
 
432
    if (!o){
 
433
      g_warning("pa_context_get_server_info() failed - ?");
 
434
      return;
 
435
    }
 
436
    
425
437
    pa_operation_unref(o);
426
438
      
427
439
    break;
621
633
  if (eol > 0) {
622
634
    return;
623
635
  }
624
 
  else {
625
 
    if (sink == NULL) {
626
 
      g_warning ("toggle_mute cb - sink parameter is null - why ?");
627
 
      return;
628
 
    }
629
 
    pa_operation_unref (pa_context_set_sink_mute_by_index (c,
630
 
                                                           sink->index,
631
 
                                                           GPOINTER_TO_INT(userdata),
632
 
                                                           NULL,
633
 
                                                           NULL));
634
 
  }
 
636
 
 
637
  if (sink == NULL) {
 
638
    g_warning ("toggle_mute cb - sink parameter is null - why ?");
 
639
    return;
 
640
  }
 
641
 
 
642
  pa_operation *operation = NULL;
 
643
  operation =  pa_context_set_sink_mute_by_index (c,
 
644
                                                  sink->index,
 
645
                                                  GPOINTER_TO_INT(userdata),
 
646
                                                  NULL,
 
647
                                                  NULL);
 
648
  if (!operation){
 
649
    g_warning ("pm_update_mic_mute operation failed for some reason");
 
650
    return;
 
651
  }
 
652
  pa_operation_unref (operation);
635
653
}
636
654
 
637
655
// Source info related callbacks