summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/audio_out.c6
-rw-r--r--src/xine-engine/input_cache.c2
-rw-r--r--src/xine-engine/xine.c6
3 files changed, 13 insertions, 1 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index def102ef3..7e43fb5cf 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -287,6 +287,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) {
@@ -1596,6 +1597,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);
}
diff --git a/src/xine-engine/input_cache.c b/src/xine-engine/input_cache.c
index 2baa67c7c..30b1ba4aa 100644
--- a/src/xine-engine/input_cache.c
+++ b/src/xine-engine/input_cache.c
@@ -34,6 +34,7 @@
*/
#include "xine_internal.h"
+#include <assert.h>
#define DEFAULT_BUFFER_SIZE 1024
@@ -190,6 +191,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;
}
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 41eeff02c..097ce99ef 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -1193,7 +1193,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;