aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-03-29 20:18:45 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-03-29 20:18:45 +0200
commite76c0c6a00b4530f2939602204520c7eabf5efdf (patch)
tree51438c5031d6ba63d677fd676ae92772dd76aabf
parent621f4c98df4ee9fd604a614f31e09eef9dd7d3ca (diff)
downloadffmpeg-e76c0c6a00b4530f2939602204520c7eabf5efdf.tar.gz
Simplify: Use FFMIN.
-rw-r--r--libavdevice/oss_audio.c4
-rw-r--r--libavdevice/sndio_enc.c4
2 files changed, 2 insertions, 6 deletions
diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c
index d2ba601f7a..fc5d3c3dd1 100644
--- a/libavdevice/oss_audio.c
+++ b/libavdevice/oss_audio.c
@@ -179,9 +179,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) {
diff --git a/libavdevice/sndio_enc.c b/libavdevice/sndio_enc.c
index fb30f62ff7..30f19107cd 100644
--- a/libavdevice/sndio_enc.c
+++ b/libavdevice/sndio_enc.c
@@ -49,9 +49,7 @@ static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
int len, ret;
while (size > 0) {
- len = s->buffer_size - s->buffer_offset;
- if (len > size)
- len = size;
+ len = FFMIN(s->buffer_size - s->buffer_offset, size);
memcpy(s->buffer + s->buffer_offset, buf, len);
buf += len;
size -= len;