From f45651f26bc3aa1b312d282c5d8c4b04be0c2505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 25 Aug 2005 15:36:29 +0000 Subject: *BUGFIX* Windows ports fixes and improvements due to my current work on toxine: - first experiments with external win32 pthreads, more portable code (pthread_t may be a struct) - headers refactored - moved dirent win32 replacement to lib/, hide it for frontends, used system version, if found, not used non-POSIX dirent->d_reclen (this item doesn't work in MinGW), fix memleak in dvb - separated settings for postproc and avcodec when using external ffmpeg - check for malloc.h in public xine.m4, used it conditionally in xine headers - replaced random() by POSIX more common rand() - prevent one segfault in directx vo plugin, if fails - M$VC port update CVS patchset: 7709 CVS date: 2005/08/25 15:36:29 --- src/xine-engine/demux.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/xine-engine/demux.c') diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 90f2d3a99..f89fec38f 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2004 the xine project + * Copyright (C) 2000-2005 the xine project * * This file is part of xine, a free video player. * @@ -20,7 +20,7 @@ * Demuxer helper functions * hide some xine engine details from demuxers and reduce code duplication * - * $Id: demux.c,v 1.58 2005/07/17 23:11:45 dsalt Exp $ + * $Id: demux.c,v 1.59 2005/08/25 15:36:30 valtri Exp $ */ @@ -150,13 +150,13 @@ void _x_demux_control_headers_done (xine_stream_t *stream) { pthread_mutex_lock (&stream->counter_lock); - if (stream->video_thread) { + if (stream->video_thread_created) { header_count_video = stream->header_count_video + 1; } else { header_count_video = 0; } - if (stream->audio_thread) { + if (stream->audio_thread_created) { header_count_audio = stream->header_count_audio + 1; } else { header_count_audio = 0; @@ -292,9 +292,9 @@ static void *demux_loop (void *stream_gen) { lprintf ("loop finished (status: %d)\n", status); pthread_mutex_lock (&stream->counter_lock); - if (stream->audio_thread) + if (stream->audio_thread_created) finished_count_audio = stream->finished_count_audio + 1; - if (stream->video_thread) + if (stream->video_thread_created) finished_count_video = stream->finished_count_video + 1; pthread_mutex_unlock (&stream->counter_lock); @@ -332,12 +332,13 @@ int _x_demux_start_thread (xine_stream_t *stream) { if( !stream->demux_thread_running ) { - if (stream->demux_thread) { + if (stream->demux_thread_created) { void *p; pthread_join(stream->demux_thread, &p); } stream->demux_thread_running = 1; + stream->demux_thread_created = 1; if ((err = pthread_create (&stream->demux_thread, NULL, demux_loop, (void *)stream)) != 0) { printf ("demux: can't create new thread (%s)\n", strerror(err)); @@ -368,9 +369,9 @@ int _x_demux_stop_thread (xine_stream_t *stream) { lprintf ("joining thread %ld\n", stream->demux_thread ); - if( stream->demux_thread ) { + if( stream->demux_thread_created ) { pthread_join (stream->demux_thread, &p); - stream->demux_thread = 0; + stream->demux_thread_created = 0; } /* -- cgit v1.2.3