Skip to content

Commit

Permalink
AudioOutputOSS: Fix Coverity 700224, 700225. Unchecked return value (…
Browse files Browse the repository at this point in the history
…of ioctl)
  • Loading branch information
stuartm committed Jun 9, 2013
1 parent c127190 commit f796163
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions mythtv/libs/libmyth/audio/audiooutputbase.h
Expand Up @@ -25,6 +25,7 @@ using namespace std;
#define VBERROR(str) LOG(VB_GENERAL, LOG_ERR, LOC + str)
#define VBWARN(str) LOG(VB_GENERAL, LOG_WARNING, LOC + str)
#define VBERRENO(str) Error(LOC + str + ": " + ENO)
#define VBERRNOCONST(str) LOG(VB_GENERAL, LOG_ERR, LOC + str + ": " + ENO)

namespace soundtouch {
class SoundTouch;
Expand Down
6 changes: 4 additions & 2 deletions mythtv/libs/libmyth/audio/audiooutputoss.cpp
Expand Up @@ -202,7 +202,8 @@ bool AudioOutputOSS::OpenDevice()
}

audio_buf_info info;
ioctl(audiofd, SNDCTL_DSP_GETOSPACE, &info);
if (ioctl(audiofd, SNDCTL_DSP_GETOSPACE, &info) < 0)
VBERRENO("Error retrieving card buffer size");
// align by frame size
fragment_size = info.fragsize - (info.fragsize % output_bytes_per_frame);

Expand Down Expand Up @@ -269,7 +270,8 @@ int AudioOutputOSS::GetBufferedOnSoundcard(void) const
int soundcard_buffer=0;
//GREG This is needs to be fixed for sure!
#ifdef SNDCTL_DSP_GETODELAY
ioctl(audiofd, SNDCTL_DSP_GETODELAY, &soundcard_buffer); // bytes
if(ioctl(audiofd, SNDCTL_DSP_GETODELAY, &soundcard_buffer) < 0) // bytes
VBERRNOCONST("Error retrieving buffering delay");
#endif
return soundcard_buffer;
}
Expand Down

0 comments on commit f796163

Please sign in to comment.