summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-25 09:42:41 +0000
committerhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-25 09:42:41 +0000
commit181233f35f41575a56e5eb091bd6426be957d8c3 (patch)
treed9d05a2686a7ca67185b31490145f1d2c97e0ee4
parent4e8a89d1b91182cc2b5e62399e00990cc9265d58 (diff)
downloadmpv-181233f35f41575a56e5eb091bd6426be957d8c3.tar.bz2
mpv-181233f35f41575a56e5eb091bd6426be957d8c3.tar.xz
added an option for specifying the size of capture buffer
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7906 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--cfg-common.h1
-rw-r--r--libmpdemux/tv.c1
-rw-r--r--libmpdemux/tv.h1
-rw-r--r--libmpdemux/tvi_v4l.c25
4 files changed, 18 insertions, 10 deletions
diff --git a/cfg-common.h b/cfg-common.h
index 7fe5476194..d961d4e8f0 100644
--- a/cfg-common.h
+++ b/cfg-common.h
@@ -253,6 +253,7 @@ struct config tvopts_conf[]={
{"balance", &tv_param_balance, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
{"forcechan", &tv_param_forcechan, CONF_TYPE_INT, CONF_RANGE, 1, 2, NULL},
{"forceaudio", &tv_param_force_audio, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+ {"buffersize", &tv_param_buffer_size, CONF_TYPE_INT, CONF_RANGE, 16, 1024, NULL},
#ifdef HAVE_ALSA9
{"alsa", &tv_param_alsa, CONF_TYPE_FLAG, 0, 0, 1, NULL},
#endif
diff --git a/libmpdemux/tv.c b/libmpdemux/tv.c
index 7ecd6339e9..082bac691f 100644
--- a/libmpdemux/tv.c
+++ b/libmpdemux/tv.c
@@ -60,6 +60,7 @@ int tv_param_treble = -1;
int tv_param_balance = -1;
int tv_param_forcechan = -1;
int tv_param_force_audio = 0;
+int tv_param_buffer_size = -1;
#ifdef HAVE_ALSA9
int tv_param_alsa = 0;
#endif
diff --git a/libmpdemux/tv.h b/libmpdemux/tv.h
index d780f68083..ca399ebb65 100644
--- a/libmpdemux/tv.h
+++ b/libmpdemux/tv.h
@@ -32,6 +32,7 @@ extern int tv_param_treble;
extern int tv_param_balance;
extern int tv_param_forcechan;
extern int tv_param_force_audio;
+extern int tv_param_buffer_size;
#ifdef HAVE_ALSA9
extern int tv_param_alsa;
#endif
diff --git a/libmpdemux/tvi_v4l.c b/libmpdemux/tvi_v4l.c
index 52d7bb4226..bfae762085 100644
--- a/libmpdemux/tvi_v4l.c
+++ b/libmpdemux/tvi_v4l.c
@@ -579,19 +579,24 @@ static int uninit(priv_t *priv)
static int get_capture_buffer_size(priv_t *priv)
{
int bufsize, cnt;
-#ifdef HAVE_SYS_SYSINFO_H
- struct sysinfo si;
-
- sysinfo(&si);
- if (si.totalram<2*1024*1024) {
- bufsize = 1024*1024;
+
+ if (tv_param_buffer_size) {
+ bufsize = tv_param_buffer_size*1024*1024;
} else {
- bufsize = si.totalram/2;
- }
+#ifdef HAVE_SYS_SYSINFO_H
+ struct sysinfo si;
+
+ sysinfo(&si);
+ if (si.totalram<2*1024*1024) {
+ bufsize = 1024*1024;
+ } else {
+ bufsize = si.totalram/2;
+ }
#else
- bufsize = 16*1024*1024;
+ bufsize = 16*1024*1024;
#endif
-
+ }
+
cnt = bufsize/(priv->height*priv->bytesperline);
if (cnt < 2) cnt = 2;