From c673c90515ab553c9ed9f4e1997600d1b3e4e2bb Mon Sep 17 00:00:00 2001 From: Reimar Döffinger Date: Tue, 29 Mar 2011 20:18:45 +0200 Subject: oss,sndio: simplify by using FFMIN. Signed-off-by: Anton Khirnov --- libavdevice/oss_audio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libavdevice/oss_audio.c') 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) { -- cgit v1.2.3