aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/oss_audio.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-03-29 20:18:45 +0200
committerAnton Khirnov <anton@khirnov.net>2011-06-09 22:53:17 +0200
commitc673c90515ab553c9ed9f4e1997600d1b3e4e2bb (patch)
treeed139a885e338588b9b98f3b179e7602a5954a97 /libavdevice/oss_audio.c
parent6b105e3ee607b4d83f894ee0c18bbd1d6f1e996f (diff)
downloadffmpeg-c673c90515ab553c9ed9f4e1997600d1b3e4e2bb.tar.gz
oss,sndio: simplify by using FFMIN.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavdevice/oss_audio.c')
-rw-r--r--libavdevice/oss_audio.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c
index af46ea890b..fcbe26ba93 100644
--- a/libavdevice/oss_audio.c
+++ b/libavdevice/oss_audio.c
@@ -181,9 +181,7 @@ static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
uint8_t *buf= pkt->data;
while (size > 0) {
- len = AUDIO_BLOCK_SIZE - s->buffer_ptr;
- if (len > size)
- len = size;
+ len = FFMIN(AUDIO_BLOCK_SIZE - s->buffer_ptr, size);
memcpy(s->buffer + s->buffer_ptr, buf, len);
s->buffer_ptr += len;
if (s->buffer_ptr >= AUDIO_BLOCK_SIZE) {