Fix bug: AudioFreeBytes fails if no audio ready.

This commit is contained in:
Johns 2012-01-13 22:39:04 +01:00
parent baf577aba5
commit eec30433b6
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,8 @@
User johns User johns
Date: Date:
Fix bug: AudioFreeBytes didn't check if audio running/compiled.
Fix bug: snd_pcm_state: Assertion `pcm' failed.
Add support for fullscreen and fullscreen toogle. Add support for fullscreen and fullscreen toogle.
Instant update deinterlace configuration changes. Instant update deinterlace configuration changes.
Fix subtitle position. Fix subtitle position.

View File

@ -1735,12 +1735,12 @@ void AudioPoller(void)
int AudioFreeBytes(void) int AudioFreeBytes(void)
{ {
#ifdef USE_ALSA #ifdef USE_ALSA
return RingBufferFreeBytes(AlsaRingBuffer); return AlsaRingBuffer ? RingBufferFreeBytes(AlsaRingBuffer) : INT32_MAX;
#endif #endif
#ifdef USE_OSS #ifdef USE_OSS
return RingBufferFreeBytes(OssRingBuffer); return OssRingBuffer ? RingBufferFreeBytes(OssRingBuffer) : INT32_MAX;
#endif #endif
return -1; return INT32_MAX; // no driver, much space
} }
/** /**