From 443fcac477f3844b4e2dcd867f7e8818b83978a7 Mon Sep 17 00:00:00 2001 From: Matthias Kretz Date: Thu, 15 Nov 2007 15:27:15 +0100 Subject: when the stream is paused fifo_wait_empty will wait forever. In that case we discard all buffers before calling fifo_wait_empty --- src/xine-engine/audio_out.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/xine-engine') diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index fb2f495d5..1f54786fc 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -290,6 +290,7 @@ struct audio_fifo_s { int num_buffers; }; +static int ao_set_property (xine_audio_port_t *this_gen, int property, int value); static audio_fifo_t *fifo_new (xine_t *xine) { @@ -1599,6 +1600,11 @@ static void ao_close(xine_audio_port_t *this_gen, xine_stream_t *stream) { xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_out: no streams left, closing driver\n"); if (this->audio_loop_running) { + if (this->clock->speed == XINE_SPEED_PAUSE || + (this->clock->speed != XINE_FINE_SPEED_NORMAL && !this->slow_fast_audio)) { + /* discard buffers, otherwise we'll wait forever */ + ao_set_property(this_gen, AO_PROP_DISCARD_BUFFERS, 1); + } /* make sure there are no more buffers on queue */ fifo_wait_empty(this->out_fifo); } -- cgit v1.2.3 From 0d62b545fbba787e72596fcc30177a6e8596a892 Mon Sep 17 00:00:00 2001 From: Matthias Kretz Date: Thu, 15 Nov 2007 15:28:04 +0100 Subject: assert that not more than the buffersize is read --- src/xine-engine/input_cache.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/xine-engine') diff --git a/src/xine-engine/input_cache.c b/src/xine-engine/input_cache.c index 75c4beb43..fea777a42 100644 --- a/src/xine-engine/input_cache.c +++ b/src/xine-engine/input_cache.c @@ -36,6 +36,7 @@ */ #include "xine_internal.h" +#include #define DEFAULT_BUFFER_SIZE 1024 @@ -192,6 +193,7 @@ static buf_element_t *cache_plugin_read_block(input_plugin_t *this_gen, fifo_buf if (buf) { buf->type = BUF_DEMUX_BLOCK; + assert(todo <= buf->max_size); read_len = cache_plugin_read (this_gen, buf->content, todo); buf->size = read_len; } -- cgit v1.2.3 From 3a6cd7956f573a2f81354467a038586e1df35d81 Mon Sep 17 00:00:00 2001 From: Matthias Kretz Date: Fri, 23 Nov 2007 18:04:25 +0100 Subject: log if send_headers returned with DEMUX_FINISHED --- src/xine-engine/xine.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 01ca48aa2..5b790343b 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -1195,7 +1195,11 @@ static int open_internal (xine_stream_t *stream, const char *mrl) { stream->demux_plugin->send_headers (stream->demux_plugin); if (stream->demux_plugin->get_status(stream->demux_plugin) != DEMUX_OK) { - xine_log (stream->xine, XINE_LOG_MSG, _("xine: demuxer failed to start\n")); + if (stream->demux_plugin->get_status(stream->demux_plugin) == DEMUX_FINISHED) { + xine_log (stream->xine, XINE_LOG_MSG, _("xine: demuxer is already done. that was fast!\n")); + } else { + xine_log (stream->xine, XINE_LOG_MSG, _("xine: demuxer failed to start\n")); + } _x_free_demux_plugin(stream, stream->demux_plugin); stream->demux_plugin = NULL; -- cgit v1.2.3