From c8d4379911fcbbb3518545585079188359d1dfc4 Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Mon, 29 Dec 2008 21:16:20 +0000 Subject: SIGSEGV in libxine (DVB, SPU) --- src/libspudvb/xine_spudvb_decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/libspudvb/xine_spudvb_decoder.c b/src/libspudvb/xine_spudvb_decoder.c index a5b34bc96..bcb0cbf96 100644 --- a/src/libspudvb/xine_spudvb_decoder.c +++ b/src/libspudvb/xine_spudvb_decoder.c @@ -804,7 +804,7 @@ static void spudec_decode_data (spu_decoder_t * this_gen, buf_element_t * buf) const uint8_t data_identifier = this->dvbsub->buf[this->dvbsub->i]; const uint8_t subtitle_stream_id = this->dvbsub->buf[this->dvbsub->i+1]; */ - this->dvbsub += 2; + this->dvbsub->i += 2; while (this->dvbsub->i <= (PES_packet_length)) { /* SUBTITLING SEGMENT */ -- cgit v1.2.3 From ed75705f86a14bfd255aa5183803e4a6c5ce90c8 Mon Sep 17 00:00:00 2001 From: Niels Vorgaard Christensen Date: Thu, 1 Jan 2009 15:42:09 +0000 Subject: libmms does not handle percent-encoded uri libmms will always fail to request media with URIs containing percent-encoded characters. This is because the path component in the MMS URI should be decoded before it is sent to the server. http://download.microsoft.com/download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/%5BMS-MMSP%5D.pdf (page 48) --- src/input/mms.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/input/mms.c b/src/input/mms.c index ab1983955..b2d00a46e 100644 --- a/src/input/mms.c +++ b/src/input/mms.c @@ -290,7 +290,7 @@ static int send_command (mms_t *this, int command, #ifdef USE_ICONV static iconv_t string_utf16_open() { - return iconv_open("UTF-16LE", nl_langinfo(CODESET)); + return iconv_open("UTF-16LE", "UTF-8"); } static void string_utf16_close(iconv_t url_conv) { @@ -771,10 +771,17 @@ mms_t *mms_connect (xine_stream_t *stream, const char *url, int bandwidth) { /* command 0x5 */ { mms_buffer_t command_buffer; - char *path = this->uri; - size_t pathlen = strlen(path); + char *path, *unescaped; + size_t pathlen; + + unescaped = strdup (this->uri); + if (!unescaped) + goto fail; + _x_mrl_unescape (unescaped); /* remove the first '/' */ + path = unescaped; + pathlen = strlen (path); if (pathlen > 1) { path++; pathlen--; @@ -785,6 +792,7 @@ mms_t *mms_connect (xine_stream_t *stream, const char *url, int bandwidth) { mms_buffer_put_32 (&command_buffer, 0x00000000); /* ?? */ mms_buffer_put_32 (&command_buffer, 0x00000000); /* ?? */ string_utf16 (url_conv, this->scmd_body + command_buffer.pos, path, pathlen); + free (unescaped); if (!send_command (this, 5, 1, 0xffffffff, pathlen * 2 + 12)) goto fail; } -- cgit v1.2.3 From 36591267df06370105922e368505ea5cc8512882 Mon Sep 17 00:00:00 2001 From: Lorenzo Desole Date: Fri, 2 Jan 2009 20:49:43 +0100 Subject: ff_audio_decode_data() doesn't always return if the stream is closed or playback stopped. --- src/combined/ffmpeg/ff_audio_decoder.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c index e0d294113..2a6c04dd3 100644 --- a/src/combined/ffmpeg/ff_audio_decoder.c +++ b/src/combined/ffmpeg/ff_audio_decoder.c @@ -367,6 +367,11 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) /* dispatch the decoded audio */ out = 0; while (out < decode_buffer_size) { + int stream_status = xine_get_status(this->stream); + + if (stream_status == XINE_STATUS_QUIT || stream_status == XINE_STATUS_STOP) + return; + audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out); if (audio_buffer->mem_size == 0) { -- cgit v1.2.3 From 398288888f6fde7697982a0c498ac724d2a6b698 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Fri, 2 Jan 2009 20:21:33 +0000 Subject: Prevent another possible hang on stream stop (demuxer waiting for audio out). The test stream sometimes causes the ASF demuxer to report "unknown GUID" several times then act as if the headers have been received, with the audio output thread waiting forever for data to be passed to it by the decoder, in this case the ffmpeg audio decoder. This particular hang occurs if playback is stopped before the demuxer has decided that headers have been received (later, and we'd have the problem which the parent cset of this cset fixes); having the demuxer control insert empty audio buffers where it would otherwise wait forever for the audio output thread to receive some data. Test stream: mmsh://213.92.19.8:80/radiodeejay?MSWMExt=.asf --- src/xine-engine/demux.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src') diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 257a72383..4f40c9848 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -138,6 +138,28 @@ void _x_demux_control_newpts( xine_stream_t *stream, int64_t pts, uint32_t flags pthread_mutex_unlock(&stream->demux_mutex); } +/* avoid ao_loop being stuck in a pthread_cond_wait, waiting for data; + * return 1 if the stream is stopped + * (better fix wanted!) + */ +static int demux_unstick_ao_loop (xine_stream_t *stream) +{ + if (!stream->audio_thread_created) + return 0; + + int status = xine_get_status (stream); + if (status != XINE_STATUS_QUIT && status != XINE_STATUS_STOP) + return 0; + + /* right, stream is stopped... */ + audio_buffer_t *buf = stream->audio_out->get_buffer (stream->audio_out); + buf->num_frames = 0; + buf->stream = NULL; + stream->audio_out->put_buffer (stream->audio_out, buf, stream); + + return 1; +} + /* sync with decoder fifos, making sure everything gets processed */ void _x_demux_control_headers_done (xine_stream_t *stream) { @@ -190,6 +212,9 @@ void _x_demux_control_headers_done (xine_stream_t *stream) { ts.tv_nsec = tv.tv_usec * 1000; /* use timedwait to workaround buggy pthread broadcast implementations */ pthread_cond_timedwait (&stream->counter_changed, &stream->counter_lock, &ts); + + if (demux_unstick_ao_loop (stream)) + break; } stream->demux_action_pending = 0; @@ -347,6 +372,9 @@ static void *demux_loop (void *stream_gen) { (stream->finished_count_video < finished_count_video)) { lprintf ("waiting for finisheds.\n"); pthread_cond_wait (&stream->counter_changed, &stream->counter_lock); + + if (demux_unstick_ao_loop (stream)) + break; } pthread_mutex_unlock (&stream->counter_lock); -- cgit v1.2.3