From 9d14da63dfd03d633c04b6ba52ebbb0aaa11004b Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 23 Sep 2004 15:19:47 +0000 Subject: - Fix crashes with some input plugins when no audio output was available That's either that, or always registering audio.num_buffers in src/xine-engine/audio_decoder.c CVS patchset: 6994 CVS date: 2004/09/23 15:19:47 --- src/input/net_buf_ctrl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/input/net_buf_ctrl.c b/src/input/net_buf_ctrl.c index d0157d5b8..489764384 100644 --- a/src/input/net_buf_ctrl.c +++ b/src/input/net_buf_ctrl.c @@ -510,7 +510,11 @@ nbc_t *nbc_init (xine_stream_t *stream) { entry = stream->xine->config->lookup_entry(stream->xine->config, "video.num_buffers"); video_fifo_factor = (double)video_fifo->buffer_pool_capacity / (double)entry->num_default; entry = stream->xine->config->lookup_entry(stream->xine->config, "audio.num_buffers"); - audio_fifo_factor = (double)audio_fifo->buffer_pool_capacity / (double)entry->num_default; + /* When there's no audio output, there's no entry */ + if (entry) + audio_fifo_factor = (double)audio_fifo->buffer_pool_capacity / (double)entry->num_default; + else + audio_fifo_factor = 230; /* use the smaller factor */ if (video_fifo_factor < audio_fifo_factor) this->high_water_mark = (double)DEFAULT_HIGH_WATER_MARK * video_fifo_factor; -- cgit v1.2.3