diff options
-rw-r--r-- | cfg-common.h | 1 | ||||
-rw-r--r-- | libmpdemux/tv.c | 1 | ||||
-rw-r--r-- | libmpdemux/tv.h | 1 | ||||
-rw-r--r-- | libmpdemux/tvi_v4l.c | 25 |
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; |