summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authorfilon <filon@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-10 18:28:18 +0000
committerfilon <filon@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-10 18:28:18 +0000
commitc7c41db7cac893d5c50a1ca01e5e1eca42f6faba (patch)
tree91b82b3547d27206d91e15ece3eae2f73216294c /libao2
parent5ebe3d8c89145d846640b984379e5f9fffd7005d (diff)
downloadmpv-c7c41db7cac893d5c50a1ca01e5e1eca42f6faba.tar.bz2
mpv-c7c41db7cac893d5c50a1ca01e5e1eca42f6faba.tar.xz
Workaround for returning very litte buffer space.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8875 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_alsa1x.c6
-rw-r--r--libao2/ao_alsa9.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/libao2/ao_alsa1x.c b/libao2/ao_alsa1x.c
index 67f3ee3bd8..b171c93dd8 100644
--- a/libao2/ao_alsa1x.c
+++ b/libao2/ao_alsa1x.c
@@ -59,6 +59,8 @@ static int alsa_fragsize = 4096;
static int alsa_fragcount = 16;
static int chunk_size = 1024; //is alsa_fragsize / 4
+#define MIN_CHUNK_SIZE 1024
+
static size_t bits_per_sample, bytes_per_sample, bits_per_frame;
static size_t chunk_bytes;
@@ -1084,6 +1086,10 @@ static int get_space()
ret = 0;
}
+ // workaround for too small value returned
+ if (ret < MIN_CHUNK_SIZE)
+ ret = 0;
+
return(ret);
}
diff --git a/libao2/ao_alsa9.c b/libao2/ao_alsa9.c
index 67f3ee3bd8..b171c93dd8 100644
--- a/libao2/ao_alsa9.c
+++ b/libao2/ao_alsa9.c
@@ -59,6 +59,8 @@ static int alsa_fragsize = 4096;
static int alsa_fragcount = 16;
static int chunk_size = 1024; //is alsa_fragsize / 4
+#define MIN_CHUNK_SIZE 1024
+
static size_t bits_per_sample, bytes_per_sample, bits_per_frame;
static size_t chunk_bytes;
@@ -1084,6 +1086,10 @@ static int get_space()
ret = 0;
}
+ // workaround for too small value returned
+ if (ret < MIN_CHUNK_SIZE)
+ ret = 0;
+
return(ret);
}