diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-01-11 20:36:33 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-01-11 20:36:33 +0000 |
commit | c706a93140a235bd0ac282c62c5985b99d125aca (patch) | |
tree | 3e672617e20af115f2d008bc85cc69b66a23b43e /libao2 | |
parent | 023340d6bdc6d05d2034400279b9ed18549445b3 (diff) | |
download | mpv-c706a93140a235bd0ac282c62c5985b99d125aca.tar.bz2 mpv-c706a93140a235bd0ac282c62c5985b99d125aca.tar.xz |
Another small simplification. Slightly worse performance in the case
where a buffer underrun happens, but this really should not matter.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25676 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2')
-rw-r--r-- | libao2/ao_jack.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libao2/ao_jack.c b/libao2/ao_jack.c index 54ec804f58..09d2dae0cd 100644 --- a/libao2/ao_jack.c +++ b/libao2/ao_jack.c @@ -120,6 +120,8 @@ static int write_buffer(unsigned char* data, int len) { return len; } +static void silence(float **bufs, int cnt, int num_bufs); + /** * \brief read data from buffer and splitting it into channels * \param bufs num_bufs float buffers, each will contain the data of one channel @@ -137,10 +139,8 @@ static int read_buffer(float **bufs, int cnt, int num_bufs) { int buffered = buf_used(); int i, j; if (cnt * sizeof(float) * num_bufs > buffered) { - int orig_cnt = cnt; + silence(bufs, cnt, num_bufs); cnt = buffered / sizeof(float) / num_bufs; - for (i = 0; i < num_bufs; i++) - memset(&bufs[i][cnt], 0, (orig_cnt - cnt) * sizeof(float)); } for (i = 0; i < cnt; i++) { for (j = 0; j < num_bufs; j++) { |