From: Thibaut M. <tma...@us...> - 2006-01-27 07:46:27
|
Update of /cvsroot/xine/xine-lib/src/xine-engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14684/xine-engine Modified Files: audio_out.c broadcaster.c events.c load_plugins.c plugin_catalog.h post.c video_out.c xine.c xine_interface.c xine_internal.h Log Message: Adapt the engine to the new list code. Index: audio_out.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/xine-engine/audio_out.c,v retrieving revision 1.194 retrieving revision 1.195 diff -u -r1.194 -r1.195 --- audio_out.c 30 Oct 2005 02:18:35 -0000 1.194 +++ audio_out.c 27 Jan 2006 07:46:15 -0000 1.195 @@ -1049,12 +1049,15 @@ pthread_mutex_unlock( &this->driver_lock ); if (in_buf && in_buf->num_frames) { + xine_list_iterator_t ite; + xprintf(this->xine, XINE_VERBOSITY_LOG, _("audio_out: delay calculation impossible with an unavailable audio device\n")); pthread_mutex_lock(&this->streams_lock); - for (stream = xine_list_first_content(this->streams); - stream; stream = xine_list_next_content(this->streams)) { + for (ite = xine_list_front(this->streams); + ite; ite = xine_list_next(this->streams, ite)) { + stream = xine_list_get_value (this->streams, ite); if( !stream->emergency_brake ) { stream->emergency_brake = 1; _x_message (stream, XINE_MSG_AUDIO_OUT_UNAVAILABLE, NULL); @@ -1134,11 +1137,12 @@ cur_time > (last_sync_time + SYNC_TIME_INVERVAL) && bufs_since_sync >= SYNC_BUF_INTERVAL && !this->resample_sync_method ) { - xine_stream_t *stream; + xine_list_iterator_t *ite; lprintf ("audio_loop: ADJ_VPTS\n"); pthread_mutex_lock(&this->streams_lock); - for (stream = xine_list_first_content(this->streams); stream; - stream = xine_list_next_content(this->streams)) { + for (ite = xine_list_front(this->streams); ite; + ite = xine_list_next(this->streams, ite)) { + xine_stream_t *stream = xine_list_get_value(this->streams, ite); if (stream == XINE_ANON_STREAM) continue; stream->metronom->set_option(stream->metronom, METRONOM_ADJ_VPTS_OFFSET, -gap/SYNC_GAP_RATE ); @@ -1230,11 +1234,13 @@ lprintf ("get_next_audio_frame\n"); while (!in_buf || !stream) { - stream = xine_list_first_content(this->streams); - if (!stream) { + xine_list_iterator_t ite = xine_list_front (this->streams); + + if (!ite) { xine_usec_sleep (5000); continue; } + stream = xine_list_get_value(this->streams, ite); /* FIXME: ugly, use conditions and locks instead? */ @@ -1445,7 +1451,7 @@ } pthread_mutex_lock(&this->streams_lock); - xine_list_append_content(this->streams, stream); + xine_list_push_back(this->streams, stream); pthread_mutex_unlock(&this->streams_lock); return this->output.rate; @@ -1512,23 +1518,25 @@ static void ao_close(xine_audio_port_t *this_gen, xine_stream_t *stream) { aos_t *this = (aos_t *) this_gen; - xine_stream_t *cur; + xine_list_iterator_t ite; xprintf (this->xine, XINE_VERBOSITY_DEBUG, "ao_close\n"); /* unregister stream */ pthread_mutex_lock(&this->streams_lock); - for (cur = xine_list_first_content(this->streams); cur; - cur = xine_list_next_content(this->streams)) + for (ite = xine_list_front(this->streams); ite; + ite = xine_list_next(this->streams, ite)) { + xine_stream_t *cur = xine_list_get_value(this->streams, ite); if (cur == stream) { - xine_list_delete_current(this->streams); + xine_list_remove(this->streams, ite); break; } - cur = xine_list_first_content(this->streams); + } + ite = xine_list_front(this->streams); pthread_mutex_unlock(&this->streams_lock); /* close driver if no streams left */ - if (!cur && !this->grab_only && !stream->gapless_switch) { + if (!ite && !this->grab_only && !stream->gapless_switch) { xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_out: no streams left, closing driver\n"); if (this->audio_loop_running) { @@ -1584,7 +1592,7 @@ pthread_mutex_destroy(&this->driver_lock); pthread_mutex_destroy(&this->driver_action_lock); pthread_mutex_destroy(&this->streams_lock); - xine_list_free(this->streams); + xine_list_delete(this->streams); free (this->frame_buf[0]->mem); free (this->frame_buf[0]->extra_info); @@ -1659,7 +1667,6 @@ static int ao_get_property (xine_audio_port_t *this_gen, int property) { aos_t *this = (aos_t *) this_gen; - xine_stream_t *cur; int ret; switch (property) { @@ -1672,11 +1679,8 @@ break; case AO_PROP_NUM_STREAMS: - ret = 0; pthread_mutex_lock(&this->streams_lock); - for (cur = xine_list_first_content(this->streams); cur; - cur = xine_list_next_content(this->streams)) - ret++; + ret = xine_list_size(this->streams); pthread_mutex_unlock(&this->streams_lock); break; @@ -1912,10 +1916,12 @@ aos_t *this = (aos_t *) this_gen; xine_stream_t *cur; int ret = 0; + xine_list_iterator_t ite; pthread_mutex_lock(&this->streams_lock); - for (cur = xine_list_first_content(this->streams); cur; - cur = xine_list_next_content(this->streams)) + for (ite = xine_list_front(this->streams); ite; + ite = xine_list_next(this->streams, ite)) { + cur = xine_list_get_value(this->streams, ite); if (cur == stream || !stream) { *bits = this->input.bits; *rate = this->input.rate; @@ -1923,6 +1929,7 @@ ret = !!stream; /* return false for a NULL stream, true otherwise */ break; } + } pthread_mutex_unlock(&this->streams_lock); return ret; Index: broadcaster.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/xine-engine/broadcaster.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- broadcaster.c 22 Jul 2004 14:25:05 -0000 1.8 +++ broadcaster.c 27 Jan 2006 07:46:15 -0000 1.9 @@ -156,10 +156,14 @@ * it sends data to every connected client (slaves). */ static void broadcaster_data_write(broadcaster_t *this, char *buf, int len) { - int *psock; + xine_list_iterator_t ite; - psock = xine_list_first_content (this->connections); - while (psock) { + ite = xine_list_front (this->connections); + while (ite) { + + int *psock = xine_list_get_value(this->connections, ite); + + ite = xine_list_next(this->connections, ite); /* in case of failure remove from list */ if( sock_data_write(this->stream->xine, *psock, buf, len) < 0 ) { @@ -167,13 +171,9 @@ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "broadcaster: closing socket %d\n", *psock); close(*psock); free(psock); - if( this->connections->cur->next ) - psock = this->connections->cur->next->content; - else - psock = NULL; - xine_list_delete_current (this->connections); - } else - psock = xine_list_next_content (this->connections); + + xine_list_remove (this->connections, xine_list_prev(this->connections, ite)); + } } } @@ -227,7 +227,7 @@ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "broadcaster: new connection socket %d\n", *psock); - xine_list_append_content(this->connections, psock); + xine_list_push_back(this->connections, psock); } } } @@ -343,20 +343,16 @@ void _x_close_broadcaster(broadcaster_t *this) { - int *psock; + xine_list_iterator_t ite; - psock = xine_list_first_content (this->connections); - while (psock) { + while ( (ite = xine_list_front(this->connections)) ) { + int *psock = xine_list_get_value(this->connections, ite); xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "broadcaster: closing socket %d\n", *psock); close(*psock); free(psock); - xine_list_delete_current (this->connections); - if( this->connections->cur ) - psock = this->connections->cur->content; - else - psock = NULL; + xine_list_remove (this->connections, ite); } - xine_list_free(this->connections); + xine_list_delete(this->connections); this->running = 0; close(this->msock); Index: events.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/xine-engine/events.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- events.c 19 Sep 2005 16:14:02 -0000 1.28 +++ events.c 27 Jan 2006 07:46:15 -0000 1.29 @@ -34,12 +34,13 @@ xine_event_t *xine_event_get (xine_event_queue_t *queue) { xine_event_t *event; + xine_list_iterator_t ite; pthread_mutex_lock (&queue->lock); - - event = (xine_event_t *) xine_list_first_content (queue->events); + ite = xine_list_front (queue->events); + event = xine_list_get_value (queue->events, ite); if (event) - xine_list_delete_current (queue->events); + xine_list_remove (queue->events, ite); pthread_mutex_unlock (&queue->lock); @@ -49,14 +50,17 @@ xine_event_t *xine_event_wait (xine_event_queue_t *queue) { xine_event_t *event; + xine_list_iterator_t ite; pthread_mutex_lock (&queue->lock); - while (!(event = (xine_event_t *) xine_list_first_content (queue->events))) { + while ( !(ite = xine_list_front (queue->events)) ) { pthread_cond_wait (&queue->new_event, &queue->lock); } - xine_list_delete_current (queue->events); + event = xine_list_get_value (queue->events, ite); + + xine_list_remove (queue->events, ite); pthread_mutex_unlock (&queue->lock); @@ -70,16 +74,17 @@ void xine_event_send (xine_stream_t *stream, const xine_event_t *event) { - xine_event_queue_t *queue; + xine_list_iterator_t ite; pthread_mutex_lock (&stream->event_queues_lock); - queue = (xine_event_queue_t *)xine_list_first_content (stream->event_queues); + ite = xine_list_front (stream->event_queues); - while (queue) { - + while (ite) { + xine_event_queue_t *queue; xine_event_t *cevent; + queue = xine_list_get_value(stream->event_queues, ite); cevent = malloc (sizeof (xine_event_t)); cevent->type = event->type; cevent->stream = stream; @@ -93,11 +98,11 @@ gettimeofday (&cevent->tv, NULL); pthread_mutex_lock (&queue->lock); - xine_list_append_content (queue->events, cevent); + xine_list_push_back (queue->events, cevent); pthread_cond_signal (&queue->new_event); pthread_mutex_unlock (&queue->lock); - queue=(xine_event_queue_t *)xine_list_next_content (stream->event_queues); + ite = xine_list_next (stream->event_queues, ite); } pthread_mutex_unlock (&stream->event_queues_lock); @@ -119,7 +124,7 @@ queue->callback_running = 0; pthread_mutex_lock (&stream->event_queues_lock); - xine_list_append_content (stream->event_queues, queue); + xine_list_push_back (stream->event_queues, queue); pthread_mutex_unlock (&stream->event_queues_lock); return queue; @@ -127,17 +132,21 @@ void xine_event_dispose_queue (xine_event_queue_t *queue) { - xine_stream_t *stream = queue->stream; - xine_event_t *event; - xine_event_t *qevent; - xine_event_queue_t *q; + xine_stream_t *stream = queue->stream; + xine_event_t *event; + xine_event_t *qevent; + xine_event_queue_t *q; + xine_list_iterator_t ite; pthread_mutex_lock (&stream->event_queues_lock); - q = (xine_event_queue_t *) xine_list_first_content (stream->event_queues); + ite = xine_list_front (stream->event_queues); + q = xine_list_get_value (stream->event_queues, ite); - while (q && (q != queue)) - q = (xine_event_queue_t *) xine_list_next_content (stream->event_queues); + while (ite && (q != queue)) { + ite = xine_list_next (stream->event_queues, ite); + q = xine_list_get_value (stream->event_queues, ite); + } if (!q) { xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "events: tried to dispose queue which is not in list\n"); @@ -146,7 +155,7 @@ return; } - xine_list_delete_current (stream->event_queues); + xine_list_remove (stream->event_queues, ite); pthread_mutex_unlock (&stream->event_queues_lock); /* @@ -161,7 +170,7 @@ gettimeofday (&qevent->tv, NULL); pthread_mutex_lock (&queue->lock); - xine_list_append_content (queue->events, qevent); + xine_list_push_back (queue->events, qevent); pthread_cond_signal (&queue->new_event); pthread_mutex_unlock (&queue->lock); @@ -212,7 +221,7 @@ xine_event_free (event); pthread_mutex_lock (&queue->lock); - if (xine_list_is_empty (queue->events)) { + if (xine_list_empty (queue->events)) { pthread_cond_signal (&queue->events_processed); } pthread_mutex_unlock (&queue->lock); Index: load_plugins.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/xine-engine/load_plugins.c,v retrieving revision 1.217 retrieving revision 1.218 diff -u -r1.217 -r1.218 --- load_plugins.c 28 Nov 2005 12:25:21 -0000 1.217 +++ load_plugins.c 27 Jan 2006 07:46:15 -0000 1.218 @@ -106,17 +106,16 @@ POST_PLUGIN_IFACE_VERSION }; -static void _build_list_typed_plugins(plugin_catalog_t **catalog, xine_list_t *type) { +static void _build_list_typed_plugins(plugin_catalog_t **catalog, xine_sarray_t *type) { plugin_node_t *node; - int i = 0; - - node = xine_list_first_content (type); - while (node) { - (*catalog)->ids[i] = node->info->id; [...970 lines suppressed...] static void dispose_plugin_file_list (xine_list_t *list) { - plugin_file_t *file; + plugin_file_t *file; + xine_list_iterator_t ite; - file = xine_list_first_content (list); - while (file) { + ite = xine_list_front (list); + while (ite) { + file = xine_list_get_value (list, ite); free (file->filename); free (file); - file = xine_list_next_content (list); + ite = xine_list_next (list, ite); } - xine_list_free(list); + xine_list_delete (list); } Index: plugin_catalog.h =================================================================== RCS file: /cvsroot/xine/xine-lib/src/xine-engine/plugin_catalog.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- plugin_catalog.h 10 Apr 2005 09:31:17 -0000 1.19 +++ plugin_catalog.h 27 Jan 2006 07:46:15 -0000 1.20 @@ -58,12 +58,13 @@ plugin_info_t *info; void *plugin_class; int ref; /* count intances of plugins */ + int priority; } plugin_node_t ; struct plugin_catalog_s { - xine_list_t *plugin_lists[PLUGIN_TYPE_MAX]; + xine_sarray_t *plugin_lists[PLUGIN_TYPE_MAX]; - xine_list_t *cache_list; + xine_sarray_t *cache_list; xine_list_t *file_list; plugin_node_t *audio_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE]; Index: post.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/xine-engine/post.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- post.c 17 Jul 2005 20:22:24 -0000 1.31 +++ post.c 27 Jan 2006 07:46:15 -0000 1.32 @@ -243,7 +243,7 @@ (*input)->xine_in.type = XINE_POST_DATA_VIDEO; (*input)->xine_in.data = &port->new_port; (*input)->post = post; - xine_list_append_content(post->input, *input); + xine_list_push_back(post->input, *input); } if (output) { @@ -255,7 +255,7 @@ (*output)->xine_out.rewire = post_video_rewire; (*output)->post = post; (*output)->user_data = port; - xine_list_append_content(post->output, *output); + xine_list_push_back(post->output, *output); } return port; @@ -725,7 +725,7 @@ (*input)->xine_in.type = XINE_POST_DATA_AUDIO; (*input)->xine_in.data = &port->new_port; (*input)->post = post; - xine_list_append_content(post->input, *input); + xine_list_push_back(post->input, *input); } if (output) { @@ -737,7 +737,7 @@ (*output)->xine_out.rewire = post_audio_rewire; (*output)->post = post; (*output)->user_data = port; - xine_list_append_content(post->output, *output); + xine_list_push_back(post->output, *output); } return port; @@ -790,6 +790,7 @@ if (!in_use) { xine_post_in_t *input; xine_post_out_t *output; + xine_list_iterator_t ite; /* we can really dispose it */ @@ -799,8 +800,9 @@ free(this->input_ids); free(this->output_ids); - for (input = xine_list_first_content(this->input); input; - input = xine_list_next_content(this->input)) { + for (ite = xine_list_front(this->input); ite; + ite = xine_list_next(this->input, ite)) { + input = xine_list_get_value(this->input, ite); switch (input->type) { case XINE_POST_DATA_VIDEO: { @@ -832,8 +834,9 @@ break; } } - for (output = xine_list_first_content(this->output); output; - output = xine_list_next_content(this->output)) { + for (ite = xine_list_front(this->output); ite; + ite = xine_list_next(this->output, ite)) { + output = xine_list_get_value(this->output, ite); switch (output->type) { case XINE_POST_DATA_VIDEO: if (output->rewire == post_video_rewire) @@ -848,8 +851,8 @@ } } - xine_list_free(this->input); - xine_list_free(this->output); + xine_list_delete(this->input); + xine_list_delete(this->output); /* since the plugin loader does not know, when the plugin gets disposed, * we have to handle the reference counter here */ Index: video_out.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/xine-engine/video_out.c,v retrieving revision 1.222 retrieving revision 1.223 diff -u -r1.222 -r1.223 --- video_out.c 14 Nov 2005 23:48:19 -0000 1.222 +++ video_out.c 27 Jan 2006 07:46:15 -0000 1.223 @@ -502,6 +502,7 @@ if (!img->bad_frame) { int img_already_locked = 0; + xine_list_iterator_t ite; /* add cropping requested by frontend */ img->crop_left += this->crop_left; @@ -543,8 +544,9 @@ */ img->is_first = 0; pthread_mutex_lock(&this->streams_lock); - for (stream = xine_list_first_content(this->streams); stream; - stream = xine_list_next_content(this->streams)) { + for (ite = xine_list_front(this->streams); ite; + ite = xine_list_next(this->streams, ite)) { + stream = xine_list_get_value(this->streams, ite); if (stream == XINE_ANON_STREAM) continue; pthread_mutex_lock (&stream->first_frame_lock); if (stream->first_frame_flag == 2) { @@ -583,6 +585,7 @@ if ((this->num_frames_delivered % 200) == 0 && this->num_frames_delivered) { int send_event; + xine_list_iterator_t ite; if( (100 * this->num_frames_skipped / this->num_frames_delivered) > this->warn_skipped_threshold || @@ -600,8 +603,9 @@ this->warn_threshold_event_sent += send_event; pthread_mutex_lock(&this->streams_lock); - for (stream = xine_list_first_content(this->streams); stream; - stream = xine_list_next_content(this->streams)) { + for (ite = xine_list_front(this->streams); ite; + ite = xine_list_next(this->streams, ite)) { + stream = xine_list_get_value(this->streams, ite); if (stream == XINE_ANON_STREAM) continue; _x_stream_info_set(stream, XINE_STREAM_INFO_SKIPPED_FRAMES, 1000 * this->num_frames_skipped / this->num_frames_delivered); @@ -967,6 +971,7 @@ static void overlay_and_display_frame (vos_t *this, vo_frame_t *img, int64_t vpts) { xine_stream_t *stream; + xine_list_iterator_t ite; lprintf ("displaying image with vpts = %" PRId64 "\n", img->vpts); @@ -1006,8 +1011,9 @@ */ if( this->last_frame->is_first ) { pthread_mutex_lock(&this->streams_lock); - for (stream = xine_list_first_content(this->streams); stream; - stream = xine_list_next_content(this->streams)) { + for (ite = xine_list_front(this->streams); ite; + ite = xine_list_next(this->streams, ite)) { + stream = xine_list_get_value(this->streams, ite); if (stream == XINE_ANON_STREAM) continue; pthread_mutex_lock (&stream->first_frame_lock); if (stream->first_frame_flag) { @@ -1149,11 +1155,12 @@ diff = vpts - this->last_delivery_pts; if (diff > 30000 && !this->display_img_buf_queue->first) { - xine_stream_t *stream; + xine_list_iterator_t ite; pthread_mutex_lock(&this->streams_lock); - for (stream = xine_list_first_content(this->streams); stream; - stream = xine_list_next_content(this->streams)) { + for (ite = xine_list_front(this->streams); ite; + ite = xine_list_next(this->streams, ite)) { + xine_stream_t *stream = xine_list_get_value(this->streams, ite); if (stream == XINE_ANON_STREAM) continue; if (stream->video_decoder_plugin && stream->video_fifo) { buf_element_t *buf; @@ -1255,12 +1262,12 @@ xine_stream_t *stream = NULL; while (!img || !stream) { - stream = xine_list_first_content(this->streams); + xine_list_iterator_t ite = xine_list_front(this->streams); + stream = xine_list_get_value(this->streams, ite); if (!stream) { xine_usec_sleep (5000); continue; } - /* FIXME: ugly, use conditions and locks instead? */ @@ -1327,14 +1334,14 @@ /* enable overlays if our new stream might want to show some */ this->overlay_enabled = 1; pthread_mutex_lock(&this->streams_lock); - xine_list_append_content(this->streams, stream); + xine_list_push_back(this->streams, stream); pthread_mutex_unlock(&this->streams_lock); } static void vo_close (xine_video_port_t *this_gen, xine_stream_t *stream) { vos_t *this = (vos_t *) this_gen; - xine_stream_t *cur; + xine_list_iterator_t ite; /* this will make sure all hide events were processed */ if (this->overlay_source) @@ -1344,19 +1351,20 @@ /* unregister stream */ pthread_mutex_lock(&this->streams_lock); - for (cur = xine_list_first_content(this->streams); cur; - cur = xine_list_next_content(this->streams)) + for (ite = xine_list_front(this->streams); ite; + ite = xine_list_next(this->streams, ite)) { + xine_stream_t *cur = xine_list_get_value(this->streams, ite); if (cur == stream) { - xine_list_delete_current(this->streams); + xine_list_remove(this->streams, ite); break; } + } pthread_mutex_unlock(&this->streams_lock); } static int vo_get_property (xine_video_port_t *this_gen, int property) { vos_t *this = (vos_t *) this_gen; - xine_stream_t *cur; int ret; switch (property) { @@ -1369,11 +1377,8 @@ break; case VO_PROP_NUM_STREAMS: - ret = 0; pthread_mutex_lock(&this->streams_lock); - for (cur = xine_list_first_content(this->streams); cur; - cur = xine_list_next_content(this->streams)) - ret++; + ret = xine_list_size(this->streams); pthread_mutex_unlock(&this->streams_lock); break; @@ -1524,12 +1529,13 @@ int *width, int *height, int64_t *img_duration) { vos_t *this = (vos_t *) this_gen; - xine_stream_t *cur; + xine_list_iterator_t ite; int ret = 0; pthread_mutex_lock(&this->streams_lock); - for (cur = xine_list_first_content(this->streams); cur; - cur = xine_list_next_content(this->streams)) + for (ite = xine_list_front(this->streams); ite; + ite = xine_list_next(this->streams, ite)) { + xine_stream_t *cur = xine_list_get_value(this->streams, ite); if (cur == stream || !stream) { *width = this->current_width; *height = this->current_height; @@ -1537,6 +1543,7 @@ ret = !!stream; /* return false for a NULL stream, true otherwise */ break; } + } pthread_mutex_unlock(&this->streams_lock); return ret; @@ -1584,7 +1591,7 @@ this->overlay_source->dispose (this->overlay_source); } - xine_list_free(this->streams); + xine_list_delete(this->streams); pthread_mutex_destroy(&this->streams_lock); free (this->free_img_buf_queue); @@ -1615,10 +1622,12 @@ this->overlay_enabled = 1; } else { /* ... but we only actually DISable, if all associated streams have SPU off */ - xine_stream_t *stream; + xine_list_iterator_t ite; + pthread_mutex_lock(&this->streams_lock); - for (stream = xine_list_first_content(this->streams) ; stream ; - stream = xine_list_next_content(this->streams)) { + for (ite = xine_list_front(this->streams); ite; + ite = xine_list_next(this->streams, ite)) { + xine_stream_t *stream = xine_list_get_value(this->streams, ite); if (stream == XINE_ANON_STREAM || stream->spu_channel_user > -2) { pthread_mutex_unlock(&this->streams_lock); return; Index: xine.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/xine-engine/xine.c,v retrieving revision 1.320 retrieving revision 1.321 diff -u -r1.320 -r1.321 --- xine.c 26 Jan 2006 12:13:23 -0000 1.320 +++ xine.c 27 Jan 2006 07:46:16 -0000 1.321 @@ -594,7 +594,7 @@ * register stream */ - xine_list_append_content (this->streams, stream); + xine_list_push_back (this->streams, stream); pthread_mutex_unlock (&this->streams_lock); @@ -630,13 +630,14 @@ void _x_flush_events_queues (xine_stream_t *stream) { - xine_event_queue_t *queue; + xine_list_iterator_t ite; pthread_mutex_lock (&stream->event_queues_lock); /* No events queue? */ - for (queue = xine_list_first_content (stream->event_queues); - queue; queue = xine_list_next_content (stream->event_queues)) { + for (ite = xine_list_front (stream->event_queues); + ite; ite = xine_list_next (stream->event_queues, ite)) { + xine_event_queue_t *queue = xine_list_get_value(stream->event_queues, ite); pthread_mutex_lock (&queue->lock); pthread_mutex_unlock (&stream->event_queues_lock); @@ -646,7 +647,7 @@ * currently executing their callback functions. */ if (queue->listener_thread != NULL && !queue->callback_running) { - while (!xine_list_is_empty (queue->events)) { + while (!xine_list_empty (queue->events)) { pthread_cond_wait (&queue->events_processed, &queue->lock); } } @@ -1258,7 +1259,7 @@ void xine_dispose_internal (xine_stream_t *stream) { - xine_stream_t *s; + xine_list_iterator_t *ite; lprintf("stream: %p\n", stream); pthread_mutex_destroy (&stream->info_mutex); @@ -1275,12 +1276,9 @@ stream->metronom->exit (stream->metronom); pthread_mutex_lock(&stream->xine->streams_lock); - for (s = xine_list_first_content(stream->xine->streams); - s; s = xine_list_next_content(stream->xine->streams)) { - if (s == stream) { - xine_list_delete_current (stream->xine->streams); - break; - } + ite = xine_list_find(stream->xine->streams, stream); + if (ite) { + xine_list_remove(stream->xine->streams, ite); } pthread_mutex_unlock(&stream->xine->streams_lock); @@ -1336,7 +1334,7 @@ _x_dispose_plugins (this); if(this->streams) { - xine_list_free(this->streams); + xine_list_delete(this->streams); pthread_mutex_destroy(&this->streams_lock); } @@ -1463,13 +1461,16 @@ strcmp(entry->str_value, xine_get_homedir()) == 0 || strcmp(entry->str_value, homedir_trail_slash) == 0)) { xine_stream_t *stream; + xine_list_iterator_t ite; xine_log(this, XINE_LOG_MSG, _("xine: The specified save_dir \"%s\" might be a security risk.\n"), entry->str_value); pthread_mutex_lock(&this->streams_lock); - if ((stream = (xine_stream_t *)xine_list_first_content(this->streams))) + if ( (ite = xine_list_front(this->streams)) ) { + stream = xine_list_get_value(this->streams, ite); _x_message(stream, XINE_MSG_SECURITY, _("The specified save_dir might be a security risk."), NULL); + } pthread_mutex_unlock(&this->streams_lock); } Index: xine_interface.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/xine-engine/xine_interface.c,v retrieving revision 1.91 retrieving revision 1.92 diff -u -r1.91 -r1.92 --- xine_interface.c 30 Oct 2005 02:18:35 -0000 1.91 +++ xine_interface.c 27 Jan 2006 07:46:16 -0000 1.92 @@ -813,26 +813,28 @@ xine_post_in_t *xine_post_input(xine_post_t *this_gen, const char *name) { post_plugin_t *this = (post_plugin_t *)this_gen; - xine_post_in_t *input; + xine_list_iterator_t ite; - input = xine_list_first_content(this->input); - while (input) { + ite = xine_list_front(this->input); + while (ite) { + xine_post_in_t *input = xine_list_get_value(this->input, ite); if (strcmp(input->name, name) == 0) return input; - input = xine_list_next_content(this->input); + ite = xine_list_next(this->input, ite); } return NULL; } xine_post_out_t *xine_post_output(xine_post_t *this_gen, const char *name) { post_plugin_t *this = (post_plugin_t *)this_gen; - xine_post_out_t *output; + xine_list_iterator_t ite; - output = xine_list_first_content(this->output); - while (output) { + ite = xine_list_front(this->output); + while (ite) { + xine_post_out_t *output = xine_list_get_value(this->output, ite); if (strcmp(output->name, name) == 0) return output; - output = xine_list_next_content(this->output); + ite = xine_list_next(this->output, ite); } return NULL; } Index: xine_internal.h =================================================================== RCS file: /cvsroot/xine/xine-lib/src/xine-engine/xine_internal.h,v retrieving revision 1.170 retrieving revision 1.171 diff -u -r1.170 -r1.171 --- xine_internal.h 26 Jan 2006 12:13:23 -0000 1.170 +++ xine_internal.h 27 Jan 2006 07:46:16 -0000 1.171 @@ -264,6 +264,7 @@ audio_decoder_t *audio_decoder_plugin; int audio_decoder_streamtype; extra_info_t *audio_decoder_extra_info; + uint32_t audio_track_map[50]; int audio_track_map_entries; uint32_t audio_type; |