~ubuntu-branches/ubuntu/vivid/mpv/vivid

« back to all changes in this revision

Viewing changes to audio/out/ao_alsa.c

  • Committer: Package Import Robot
  • Author(s): Logan Rosen
  • Date: 2014-12-22 19:08:25 UTC
  • mfrom: (28.1.3 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20141222190825-bdtz8aiwvv65wpmi
Tags: 0.7.2-1ubuntu1
debian/rules: Disable altivec on ppc64el again, as it FTBFS with it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
461
461
        if (strcmp(device, "default") != 0)
462
462
            device = talloc_asprintf(ao, "plug:%s", device);
463
463
    }
 
464
    const char *old_dev = device;
464
465
    if (ao->device)
465
466
        device = ao->device;
466
467
    if (p->cfg_device && p->cfg_device[0])
467
468
        device = p->cfg_device;
 
469
    bool user_set_device = device != old_dev; // not strcmp()
468
470
 
469
471
    MP_VERBOSE(ao, "using device: %s\n", device);
470
472
    MP_VERBOSE(ao, "using ALSA version: %s\n", snd_asoundlib_version());
471
473
 
472
474
    err = try_open_device(ao, device, p->cfg_block ? 0 : SND_PCM_NONBLOCK);
473
475
    if (err < 0) {
474
 
        if (err != -EBUSY && !p->cfg_block) {
 
476
        if (err == -EBUSY && !user_set_device && strcmp(device, "default") != 0) {
 
477
            MP_WARN(ao, "Device '%s' busy, retrying default.\n", device);
 
478
            err = try_open_device(ao, "default", 0);
 
479
        } else if (err != -EBUSY && !p->cfg_block) {
475
480
            MP_WARN(ao, "Open in nonblock-mode "
476
481
                    "failed, trying to open in block-mode.\n");
477
482
            err = try_open_device(ao, device, 0);
630
635
            MP_WARN(ao, "Got unknown channel map from ALSA.\n");
631
636
        }
632
637
 
 
638
        if (ao->channels.num == 1)
 
639
            ao->channels.speaker[0] = MP_SP(FC);
 
640
 
633
641
        free(alsa_chmap);
634
642
    }
635
643
#endif