summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@users.sourceforge.net>2004-09-23 15:19:47 +0000
committerBastien Nocera <hadess@users.sourceforge.net>2004-09-23 15:19:47 +0000
commit9d14da63dfd03d633c04b6ba52ebbb0aaa11004b (patch)
treed6b27ba95531878dde1ffd40333cfc51a789a56a
parent983e4dd1dbd74b3aea742f5eb702275c8715f541 (diff)
downloadxine-lib-9d14da63dfd03d633c04b6ba52ebbb0aaa11004b.tar.gz
xine-lib-9d14da63dfd03d633c04b6ba52ebbb0aaa11004b.tar.bz2
- 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
-rw-r--r--ChangeLog1
-rw-r--r--src/input/net_buf_ctrl.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 06e34ba27..e7655adb6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
automatic software cropping is provided for drivers not supporting it.
* Fixed displaying of mpeg2 files where width/height is not a multiple of 16
(these files required cropping after decoding)
+ * Fix crashes with some input plugins when no audio output was available
xine-lib (1-rc6)
* Moved win32 frontend into separate module.
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;