~ubuntu-branches/debian/sid/mumble/sid

« back to all changes in this revision

Viewing changes to .pc/17-change-pulseaudio-role.diff/src/mumble/PulseAudio.cpp

  • Committer: Package Import Robot
  • Author(s): Christopher Knadle
  • Date: 2014-08-28 16:23:17 UTC
  • mfrom: (1.4.14)
  • Revision ID: package-import@ubuntu.com-20140828162317-nakwb6ie31slej4t
Tags: 1.2.8-1
* New upstream stable release from 2014-08-09
* debian/control:
    - Remove uploader Thorvald Natvig <thorvald@debian.org> due to
      inactivity; thanks very much for your prior contributions.
* debian/patches:
    - Remove 23-fix-pulseaudio-segfault-pt1.diff
             24-fix-pulseaudio-segfault-pt2.diff
      Both patches incorporated upstream in 1.2.8
    - Add 25-make-logfiles-readable-by-adm.diff to make mumble-server log
      files readable by group adm.  Closes: #759287
      Thanks to Jan Braun <janbraun@gmx.net> for reporting the bug and
      submitting a patch.
* debian/mumble-server.postinst:
    - Add check for existance of mumble-server group entry before creation
      of group and user.  Closes: #758833
      Thanks to William Martin <william.martin@power-lan.com> for reporting
      the bug and discussing a fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
455
455
        PulseAudioSystem *pas = reinterpret_cast<PulseAudioSystem *>(userdata);
456
456
 
457
457
        size_t length = bytes;
458
 
        const void *data;
 
458
        const void *data = NULL;
459
459
        pa_stream_peek(s, &data, &length);
 
460
        if (data == NULL && length > 0) {
 
461
                qWarning("PulseAudio: pa_stream_peek reports no data at current read index.");
 
462
        } else if (data == NULL && length == 0) {
 
463
                qWarning("PulseAudio: pa_stream_peek reports empty memblockq.");
 
464
        } else if (data == NULL || length == 0) {
 
465
                qWarning("PulseAudio: invalid pa_stream_peek state encountered.");
 
466
                return;
 
467
        }
460
468
 
461
469
        AudioInputPtr ai = g.ai;
462
470
        PulseAudioInput *pai = dynamic_cast<PulseAudioInput *>(ai.get());
463
471
        if (! pai) {
464
 
                pa_stream_drop(s);
 
472
                if (length > 0) {
 
473
                        pa_stream_drop(s);
 
474
                }
465
475
                pas->wakeup();
466
476
                return;
467
477
        }
479
489
                                pai->eMicFormat = PulseAudioInput::SampleShort;
480
490
                        pai->initializeMixer();
481
491
                }
482
 
                pai->addMic(data, length / pai->iMicSampleSize);
 
492
                if (data != NULL) {
 
493
                        pai->addMic(data, length / pai->iMicSampleSize);
 
494
                }
483
495
        } else if (s == pas->pasSpeaker) {
484
496
                if (!pa_sample_spec_equal(pss, &pai->pssEcho)) {
485
497
                        pai->pssEcho = *pss;
491
503
                                pai->eEchoFormat = PulseAudioInput::SampleShort;
492
504
                        pai->initializeMixer();
493
505
                }
494
 
                pai->addEcho(data, length / pai->iEchoSampleSize);
 
506
                if (data != NULL) {
 
507
                        pai->addEcho(data, length / pai->iEchoSampleSize);
 
508
                }
495
509
        }
496
510
 
497
 
        pa_stream_drop(s);
 
511
        if (length > 0) {
 
512
                pa_stream_drop(s);
 
513
        }
498
514
}
499
515
 
500
516
void PulseAudioSystem::write_callback(pa_stream *s, size_t bytes, void *userdata) {