Skip to content
Permalink
Browse files

AudioInputOSS: Fix Coverity 700242, 700243. Unchecked return value (o…

…f ioctl)
  • Loading branch information
stuartm committed Jun 9, 2013
1 parent 2110818 commit 3b2950724f07bb31ce3c2149ffbe541fe07efad6
Showing with 11 additions and 3 deletions.
  1. +11 −3 mythtv/libs/libmythtv/recorders/audioinputoss.cpp
@@ -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:
@@ -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)
{

0 comments on commit 3b29507

Please sign in to comment.
You can’t perform that action at this time.