diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2003-02-21 01:13:55 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2003-02-21 01:13:55 +0000 |
commit | 18a755d4704006c1cc5ac84401678a3f8f671cde (patch) | |
tree | 64afc67a51fb1c912485822b8d3b83cdf52dd0ff | |
parent | 10d0292a54d296d0ad280db307dfcfb318fa83f1 (diff) | |
download | xine-lib-18a755d4704006c1cc5ac84401678a3f8f671cde.tar.gz xine-lib-18a755d4704006c1cc5ac84401678a3f8f671cde.tar.bz2 |
make number of video buffers user-configurable
CVS patchset: 4223
CVS date: 2003/02/21 01:13:55
-rw-r--r-- | src/xine-engine/video_decoder.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index 523a6516f..414b5c891 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_decoder.c,v 1.128 2003/02/18 18:38:55 mroi Exp $ + * $Id: video_decoder.c,v 1.129 2003/02/21 01:13:55 guenter Exp $ * */ @@ -370,16 +370,25 @@ void video_decoder_init (xine_stream_t *stream) { pthread_attr_t pth_attrs; struct sched_param pth_params; - int err; + int err, num_buffers; /* The fifo size is based on dvd playback where buffers are filled - * with 2k of data. With 1000 buffers and a typical video data rate - * of 8 Mbit/s, the fifo can hold about 2 seconds of video, wich + * with 2k of data. With 500 buffers and a typical video data rate + * of 8 Mbit/s, the fifo can hold about 1 second of video, wich * should be enough to compensate for drive delays. * We provide buffers of 8k size instead of 2k for demuxers sending * larger chunks. */ - stream->video_fifo = fifo_buffer_new (1000, 8192); + + num_buffers = stream->xine->config->register_num (stream->xine->config, + "video.num_buffers", + 500, + "number of video buffers to allocate (higher values mean smoother playback but higher latency)", + NULL, 20, + NULL, NULL); + + + stream->video_fifo = fifo_buffer_new (num_buffers, 8192); stream->spu_track_map_entries = 0; pthread_attr_init(&pth_attrs); |