diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/audio_dec/xine_mad_decoder.c | 2 | ||||
-rw-r--r-- | src/demuxers/asfheader.c | 3 | ||||
-rw-r--r-- | src/demuxers/demux_matroska.c | 2 | ||||
-rw-r--r-- | src/input/input_vcd.c | 17 | ||||
-rw-r--r-- | src/input/libdvdnav/dvd_input.c | 1 | ||||
-rw-r--r-- | src/input/pnm.c | 1 | ||||
-rw-r--r-- | src/post/audio/upmix.c | 2 | ||||
-rwxr-xr-x | src/post/goom/gfontlib.c | 1 | ||||
-rw-r--r-- | src/spu_dec/cmml_decoder.c | 11 | ||||
-rw-r--r-- | src/xine-engine/audio_decoder.c | 4 | ||||
-rw-r--r-- | src/xine-engine/audio_out.c | 2 | ||||
-rw-r--r-- | src/xine-engine/demux.c | 7 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.c | 8 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 2 |
14 files changed, 42 insertions, 21 deletions
diff --git a/src/audio_dec/xine_mad_decoder.c b/src/audio_dec/xine_mad_decoder.c index 3338028dd..ac16e84a6 100644 --- a/src/audio_dec/xine_mad_decoder.c +++ b/src/audio_dec/xine_mad_decoder.c @@ -190,7 +190,7 @@ static void mad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { mad_stream_buffer (&this->stream, this->buffer, this->bytes_in_buffer); - if (this->bytes_in_buffer < MAD_MIN_SIZE) + if (this->bytes_in_buffer < MAD_MIN_SIZE && buf->pts == 0) return; if (!this->needs_more_data) { diff --git a/src/demuxers/asfheader.c b/src/demuxers/asfheader.c index 9639ea4f7..54326c1d5 100644 --- a/src/demuxers/asfheader.c +++ b/src/demuxers/asfheader.c @@ -296,6 +296,9 @@ static int asf_header_parse_stream_properties(asf_header_t *header, uint8_t *buf if (! (asf_stream = malloc(sizeof(asf_stream_t))) )
goto exit_error;
+ asf_stream->private_data = NULL;
+ asf_stream->error_correction_data = NULL;
+
asf_reader_init(&reader, buffer, buffer_len);
asf_reader_get_guid(&reader, &guid);
diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c index 9deaca161..2c0b7df4f 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -1449,7 +1449,7 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) { track->buf_type = BUF_SPU_HDMV; init_codec = init_codec_spu; } else { - lprintf("unknown codec\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "unknown codec %s\n", track->codec_id); } if (track->buf_type) { diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c index 8f780de29..c1d2d0ece 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.c @@ -29,6 +29,7 @@ #include <errno.h> #include <fcntl.h> #include <sys/ioctl.h> +#include <sys/param.h> #include <string.h> #include <netinet/in.h> #ifdef HAVE_LINUX_CDROM_H @@ -92,7 +93,7 @@ typedef struct { #if defined (__linux__) || defined(__sun) struct cdrom_tochdr tochdr; struct cdrom_tocentry tocent[100]; -#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#elif (defined(BSD) && BSD >= 199306) struct ioc_toc_header tochdr; struct cd_toc_entry *tocent; off_t cur_sec; @@ -117,7 +118,7 @@ typedef struct { int cur_track; -#if defined (__linux__) || defined(__sun) || defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#if defined (__linux__) || defined(__sun) || (defined(BSD) && BSD >= 199306) uint8_t cur_min, cur_sec, cur_frame; #endif @@ -177,7 +178,7 @@ static int input_vcd_read_toc (vcd_input_class_t *this, int fd) { return 0; } -#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#elif (defined(BSD) && BSD >= 199306) static int input_vcd_read_toc (vcd_input_class_t *this, int fd) { struct ioc_read_toc_entry te; @@ -394,7 +395,7 @@ static off_t vcd_plugin_read (input_plugin_t *this_gen, memcpy (buf, data.data, VCDSECTORSIZE); /* FIXME */ return VCDSECTORSIZE; } -#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#elif (defined(BSD) && BSD >= 199306) static off_t vcd_plugin_read (input_plugin_t *this_gen, void *buf_gen, off_t nlen) { vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen; @@ -534,7 +535,7 @@ static buf_element_t *vcd_plugin_read_block (input_plugin_t *this_gen, memcpy (buf->mem, data.data, VCDSECTORSIZE); /* FIXME */ return buf; } -#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#elif (defined(BSD) && BSD >= 199306) static buf_element_t *vcd_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, off_t nlen) { @@ -693,7 +694,7 @@ static off_t vcd_plugin_seek (input_plugin_t *this_gen, return offset ; /* FIXME */ } -#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#elif (defined(BSD) && BSD >= 199306) static off_t vcd_plugin_seek (input_plugin_t *this_gen, off_t offset, int origin) { @@ -767,7 +768,7 @@ static off_t vcd_plugin_get_length (input_plugin_t *this_gen) { return (off_t) 0; } -#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) +#elif (defined(BSD) && BSD >= 199306) static off_t vcd_plugin_get_length (input_plugin_t *this_gen) { vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen; off_t len ; @@ -862,7 +863,7 @@ static int vcd_plugin_open (input_plugin_t *this_gen) { this->cur_min = this->cls->tocent[this->cur_track].cdte_addr.msf.minute; this->cur_sec = this->cls->tocent[this->cur_track].cdte_addr.msf.second; this->cur_frame = this->cls->tocent[this->cur_track].cdte_addr.msf.frame; -#elif defined (__OpenBSD__) +#elif defined (__OpenBSD__) || defined(__NetBSD__) this->cur_min = this->cls->tocent[this->cur_track + 1 - this->cls->tochdr.starting_track].addr.msf.minute; this->cur_sec = this->cls->tocent[this->cur_track + 1 - this->cls->tochdr.starting_track].addr.msf.second; this->cur_frame = this->cls->tocent[this->cur_track + 1 - this->cls->tochdr.starting_track].addr.msf.frame; diff --git a/src/input/libdvdnav/dvd_input.c b/src/input/libdvdnav/dvd_input.c index 7b35f5eef..8eea51412 100644 --- a/src/input/libdvdnav/dvd_input.c +++ b/src/input/libdvdnav/dvd_input.c @@ -319,6 +319,7 @@ static int file_read(dvd_input_t dev, void *buffer, int blocks, int flags) return (int) (bytes / DVD_VIDEO_LB_LEN); } + buffer += ret; len -= ret; } diff --git a/src/input/pnm.c b/src/input/pnm.c index f44b7dcaa..d07d35c7e 100644 --- a/src/input/pnm.c +++ b/src/input/pnm.c @@ -714,6 +714,7 @@ pnm_t *pnm_connect(xine_stream_t *stream, const char *mrl) { if (strncmp(mrl,"pnm://",6)) { + free (mrl_ptr); return NULL; } diff --git a/src/post/audio/upmix.c b/src/post/audio/upmix.c index c8f7c0121..97edd47dd 100644 --- a/src/post/audio/upmix.c +++ b/src/post/audio/upmix.c @@ -396,6 +396,8 @@ static post_plugin_t *upmix_open_plugin(post_class_t *class_gen, int inputs, _x_post_init(&this->post, 1, 0); + pthread_mutex_init(&this->lock, NULL); + this->params.cut_off_freq = 100; port = _x_post_intercept_audio_port(&this->post, audio_target[0], &input, &output); diff --git a/src/post/goom/gfontlib.c b/src/post/goom/gfontlib.c index 2bc366305..f538aad34 100755 --- a/src/post/goom/gfontlib.c +++ b/src/post/goom/gfontlib.c @@ -127,6 +127,7 @@ void gfont_load (void) { font_chars [32] = 0; small_font_chars [32] = 0; free(font_pos); + free(gfont); } void goom_draw_text (Pixel * buf,int resolx,int resoly, diff --git a/src/spu_dec/cmml_decoder.c b/src/spu_dec/cmml_decoder.c index 912e1aed3..53d5fa9ea 100644 --- a/src/spu_dec/cmml_decoder.c +++ b/src/spu_dec/cmml_decoder.c @@ -331,9 +331,9 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { /* how many lines does the anchor text take up? */ this->lines=0; { - int i = 0; - while (*anchor_text) { - if (*anchor_text == '\r' || *anchor_text == '\n') { + int i = 0, index = 0; + while (anchor_text[index]) { + if (anchor_text[index] == '\r' || anchor_text[index] == '\n') { if (i) { /* match a newline and there are chars on the current line ... */ this->text[ this->lines ][i] = '\0'; @@ -342,11 +342,11 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { } } else { /* found a normal (non-line-ending) character */ - this->text[ this->lines ][i] = *anchor_text; + this->text[ this->lines ][i] = anchor_text[index]; if (i<SUB_BUFSIZE-1) i++; } - anchor_text++; + index++; } /* always NULL-terminate the string */ @@ -355,6 +355,7 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { this->lines++; } } + free (anchor_text); /* initialize decoder if needed */ if( !this->cached_width || !this->cached_height || !this->cached_img_duration || !this->osd ) { diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 687121457..e2d0acd04 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.c @@ -463,7 +463,9 @@ static void *audio_decoder_loop (void *stream_gen) { int _x_audio_decoder_init (xine_stream_t *stream) { pthread_attr_t pth_attrs; +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING struct sched_param pth_params; +#endif int err; if (stream->audio_out == NULL) { @@ -501,10 +503,12 @@ int _x_audio_decoder_init (xine_stream_t *stream) { */ pthread_attr_init(&pth_attrs); +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING pthread_attr_getschedparam(&pth_attrs, &pth_params); pth_params.sched_priority = sched_get_priority_min(SCHED_OTHER); pthread_attr_setschedparam(&pth_attrs, &pth_params); pthread_attr_setscope(&pth_attrs, PTHREAD_SCOPE_SYSTEM); +#endif stream->audio_thread_created = 1; if ((err = pthread_create (&stream->audio_thread, diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 6405f6346..5bb8242ae 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -2286,7 +2286,9 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, this->audio_loop_running = 1; pthread_attr_init(&pth_attrs); +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING pthread_attr_setscope(&pth_attrs, PTHREAD_SCOPE_SYSTEM); +#endif this->audio_thread_created = 1; if ((err = pthread_create (&this->audio_thread, diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 0321d7404..d61ca963a 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -343,13 +343,8 @@ static void *demux_loop (void *stream_gen) { /* someone may want to interrupt us */ if (_x_action_pending(stream)) { - struct timeval tv; struct timespec ts; - - gettimeofday(&tv, NULL); - ts.tv_sec = tv.tv_sec; - ts.tv_nsec = (tv.tv_usec + 100000) * 1000; - + ts = _x_compute_interval(100); pthread_cond_timedwait (&stream->demux_resume, &stream->demux_lock, &ts); } } diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index c548d12ef..29bc26d69 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.c @@ -42,6 +42,10 @@ #define SPU_SLEEP_INTERVAL (90000/2) +#ifndef SCHED_OTHER +#define SCHED_OTHER 0 +#endif + static void update_spu_decoder (xine_stream_t *stream, int type) { @@ -487,7 +491,9 @@ int _x_video_decoder_init (xine_stream_t *stream) { } else { pthread_attr_t pth_attrs; +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING struct sched_param pth_params; +#endif int err, num_buffers; /* The fifo size is based on dvd playback where buffers are filled * with 2k of data. With 500 buffers and a typical video data rate @@ -516,10 +522,12 @@ int _x_video_decoder_init (xine_stream_t *stream) { stream->spu_track_map_entries = 0; pthread_attr_init(&pth_attrs); +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING pthread_attr_getschedparam(&pth_attrs, &pth_params); pth_params.sched_priority = sched_get_priority_min(SCHED_OTHER); pthread_attr_setschedparam(&pth_attrs, &pth_params); pthread_attr_setscope(&pth_attrs, PTHREAD_SCOPE_SYSTEM); +#endif stream->video_thread_created = 1; if ((err = pthread_create (&stream->video_thread, diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 4372226ad..ea04051e2 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -1970,7 +1970,9 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabon this->grab_only = 0; pthread_attr_init(&pth_attrs); +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING pthread_attr_setscope(&pth_attrs, PTHREAD_SCOPE_SYSTEM); +#endif if ((err = pthread_create (&this->video_thread, &pth_attrs, video_out_loop, this)) != 0) { |