Skip to content

Commit

Permalink
AudioInputOSS: Fix Coverity 700242, 700243. Unchecked return value (o…
Browse files Browse the repository at this point in the history
…f ioctl)
  • Loading branch information
stuartm committed Jun 9, 2013
1 parent 2110818 commit 3b29507
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions mythtv/libs/libmythtv/recorders/audioinputoss.cpp
Expand Up @@ -64,11 +64,15 @@ bool AudioInputOSS::Open(uint sample_bits, uint sample_rate, uint channels)
}

chk = 0; // disable input for now
ioctl(dsp_fd, SNDCTL_DSP_SETTRIGGER, &chk);
if (ioctl(dsp_fd, SNDCTL_DSP_SETTRIGGER, &chk) < 0)
{
LOG(VB_GENERAL, LOG_WARNING, LOC_DEV +
QString("failed to disable audio device %1: ").arg(tag) + ENO);
}

// Set format
int format, choice;
QString tag = QString::null;
QString tag;
switch (sample_bits)
{
case 8:
Expand Down Expand Up @@ -165,7 +169,11 @@ bool AudioInputOSS::Start(void)
if (IsOpen())
{
int trig = 0; // clear
ioctl(dsp_fd, SNDCTL_DSP_SETTRIGGER, &trig);
if (ioctl(dsp_fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0)
{
LOG(VB_GENERAL, LOG_WARNING, LOC_DEV +
QString("failed to disable audio device %1: ").arg(tag) + ENO);
}
trig = PCM_ENABLE_INPUT; // enable input
if (ioctl(dsp_fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0)
{
Expand Down

0 comments on commit 3b29507

Please sign in to comment.