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

« back to all changes in this revision

Viewing changes to audio/out/ao_coreaudio.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:
354
354
 
355
355
    AudioChannelDescription *descs = layout->mChannelDescriptions;
356
356
 
357
 
    MP_VERBOSE(ao, "layout: tag: <%d>, bitmap: <%d>, "
358
 
                   "descriptions <%d>\n",
359
 
                   layout->mChannelLayoutTag,
360
 
                   layout->mChannelBitmap,
361
 
                   layout->mNumberChannelDescriptions);
 
357
    MP_VERBOSE(ao, "layout: tag: <%u>, bitmap: <%u>, "
 
358
                   "descriptions <%u>\n",
 
359
                   (unsigned) layout->mChannelLayoutTag,
 
360
                   (unsigned) layout->mChannelBitmap,
 
361
                   (unsigned) layout->mNumberChannelDescriptions);
362
362
 
363
363
    for (int i = 0; i < layout->mNumberChannelDescriptions; i++) {
364
364
        AudioChannelDescription d = descs[i];
365
 
        MP_VERBOSE(ao, " - description %d: label <%d, %d>, flags: <%u>, "
366
 
                       "coords: <%f, %f, %f>\n", i,
367
 
                       d.mChannelLabel,
368
 
                       ca_label_to_mp_speaker_id(d.mChannelLabel),
369
 
                       d.mChannelFlags,
 
365
        MP_VERBOSE(ao, " - description %d: label <%u, %u>, "
 
366
                       " flags: <%u>, coords: <%f, %f, %f>\n", i,
 
367
                       (unsigned) d.mChannelLabel,
 
368
                       (unsigned) ca_label_to_mp_speaker_id(d.mChannelLabel),
 
369
                       (unsigned) d.mChannelFlags,
370
370
                       d.mCoordinates[0],
371
371
                       d.mCoordinates[1],
372
372
                       d.mCoordinates[2]);
 
373
 
 
374
        if (i >= 32) {
 
375
            MP_VERBOSE(ao, " detected more than 32 channel descriptions, "
 
376
                       "skipping output");
 
377
            break;
 
378
        }
373
379
    }
374
380
}
375
381
 
410
416
    //   to the waveextensible definition: this is the kind of
411
417
    //   descriptions we process here.
412
418
 
 
419
    if (layout->mNumberChannelDescriptions > MP_NUM_CHANNELS) {
 
420
        MP_VERBOSE(ao, "layout has too many descriptions (%u, max: %d)\n",
 
421
                   (unsigned) layout->mNumberChannelDescriptions,
 
422
                   MP_NUM_CHANNELS);
 
423
        return false;
 
424
    }
 
425
 
413
426
    for (int n = 0; n < layout->mNumberChannelDescriptions; n++) {
414
427
        AudioChannelLabel label = layout->mChannelDescriptions[n].mChannelLabel;
415
428
        uint8_t speaker = ca_label_to_mp_speaker_id(label);
416
429
        if (label == kAudioChannelLabel_Unknown)
417
430
            continue;
418
431
        if (speaker < 0) {
419
 
            MP_VERBOSE(ao, "channel label=%d unusable to build channel "
420
 
                           "bitmap, skipping layout\n", label);
 
432
            MP_VERBOSE(ao, "channel label=%u unusable to build channel "
 
433
                           "bitmap, skipping layout\n", (unsigned) label);
 
434
            goto coreaudio_error;
421
435
        } else {
422
436
            chmap->speaker[n] = speaker;
423
437
            chmap->num = n + 1;