diff options
author | henry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-25 09:42:41 +0000 |
---|---|---|
committer | henry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-25 09:42:41 +0000 |
commit | 181233f35f41575a56e5eb091bd6426be957d8c3 (patch) | |
tree | d9d05a2686a7ca67185b31490145f1d2c97e0ee4 /libmpdemux | |
parent | 4e8a89d1b91182cc2b5e62399e00990cc9265d58 (diff) | |
download | mpv-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
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/tv.c | 1 | ||||
-rw-r--r-- | libmpdemux/tv.h | 1 | ||||
-rw-r--r-- | libmpdemux/tvi_v4l.c | 25 |
3 files changed, 17 insertions, 10 deletions
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; |