diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2010-02-23 21:58:55 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2010-02-23 21:58:55 +0000 |
commit | 87db48cae2e7875af646327143e09e1c4cd230ad (patch) | |
tree | 8678bfe0704e49385120a868d4c8eee9bde3ece7 | |
parent | 17ba620ad8321870852c55fbf8d7244793f0710e (diff) | |
download | xine-lib-87db48cae2e7875af646327143e09e1c4cd230ad.tar.gz xine-lib-87db48cae2e7875af646327143e09e1c4cd230ad.tar.bz2 |
Prevent discard_{frames,buffers} from going negative.
Based on patches from Roger Scott <ras351@hotmail.com>.
-rw-r--r-- | src/xine-engine/audio_out.c | 5 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 4f68b8975..985520759 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -1889,8 +1889,11 @@ static int ao_set_property (xine_audio_port_t *this_gen, int property, int value /* recursive discard buffers setting */ if(value) this->discard_buffers++; - else + else if (this->discard_buffers) this->discard_buffers--; + else + xprintf (this->xine, XINE_VERBOSITY_DEBUG, + "ao_set_property: discard_buffers is already zero\n"); ret = this->discard_buffers; diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 0b6d8f7a1..d06e82afa 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -1469,8 +1469,11 @@ static int vo_set_property (xine_video_port_t *this_gen, int property, int value pthread_mutex_lock(&this->display_img_buf_queue->mutex); if(value) this->discard_frames++; - else + else if (this->discard_frames) this->discard_frames--; + else + xprintf (this->xine, XINE_VERBOSITY_DEBUG, + "vo_set_property: discard_frames is already zero\n"); pthread_mutex_unlock(&this->display_img_buf_queue->mutex); ret = this->discard_frames; |