diff options
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/video_decoder.c | 12 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 53 | ||||
-rw-r--r-- | src/xine-engine/video_out.h | 10 | ||||
-rw-r--r-- | src/xine-engine/xine_internal.h | 4 |
4 files changed, 39 insertions, 40 deletions
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index c03030b31..971b38d0b 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_decoder.c,v 1.51 2001/09/14 21:25:55 richwareham Exp $ + * $Id: video_decoder.c,v 1.52 2001/09/26 01:18:19 guenter Exp $ * */ @@ -51,7 +51,6 @@ void *video_decoder_loop (void *this_gen) { buf_element_t *buf; xine_t *this = (xine_t *) this_gen; int running = 1; - int i; int streamtype; video_decoder_t *decoder; spu_decoder_t *spu_decoder; @@ -91,11 +90,6 @@ void *video_decoder_loop (void *this_gen) { pthread_mutex_lock (&this->xine_lock); this->video_finished = 0; this->spu_finished = 0; - /* FIXME: I don't think we need spu_track_map. */ - for (i=0 ; i<50; i++) - this->spu_track_map[0] = 0; - - this->spu_track_map_entries = 0; pthread_mutex_unlock (&this->xine_lock); @@ -114,6 +108,10 @@ void *video_decoder_loop (void *this_gen) { profiler_stop_count (prof_spu_decode); break; + case BUF_CONTROL_SPU_CHANNEL: + this->spu_channel = buf->decoder_info[0]; + break; + case BUF_SPU_PACKAGE: profiler_start_count (prof_spu_decode); diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index ad8887e26..b7df39b51 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out.c,v 1.46 2001/09/14 21:25:55 richwareham Exp $ + * $Id: video_out.c,v 1.47 2001/09/26 01:18:19 guenter Exp $ * */ @@ -44,7 +44,7 @@ struct img_buf_fifo_s { int num_buffers; pthread_mutex_t mutex; - pthread_cond_t bNotEmpty; + pthread_cond_t not_empty; } ; @@ -58,7 +58,7 @@ static img_buf_fifo_t *vo_new_img_buf_queue () { queue->last = NULL; queue->num_buffers = 0; pthread_mutex_init (&queue->mutex, NULL); - pthread_cond_init (&queue->bNotEmpty, NULL); + pthread_cond_init (&queue->not_empty, NULL); } return queue; } @@ -82,7 +82,7 @@ static void vo_append_to_img_buf_queue (img_buf_fifo_t *queue, queue->num_buffers++; - pthread_cond_signal (&queue->bNotEmpty); + pthread_cond_signal (&queue->not_empty); pthread_mutex_unlock (&queue->mutex); } @@ -93,7 +93,7 @@ static vo_frame_t *vo_remove_from_img_buf_queue (img_buf_fifo_t *queue) { while (!queue->first) { /* printf ("video_out: queue %d empty...\n", queue); */ - pthread_cond_wait (&queue->bNotEmpty, &queue->mutex); + pthread_cond_wait (&queue->not_empty, &queue->mutex); } img = queue->first; @@ -104,7 +104,7 @@ static vo_frame_t *vo_remove_from_img_buf_queue (img_buf_fifo_t *queue) { if (!queue->first) { queue->last = NULL; queue->num_buffers = 0; - pthread_cond_init (&queue->bNotEmpty, NULL); + pthread_cond_init (&queue->not_empty, NULL); } else { queue->num_buffers--; @@ -238,9 +238,9 @@ static void *video_out_loop (void *this_gen) { img = vo_remove_from_img_buf_queue (this->display_img_buf_queue); pthread_mutex_lock (&img->mutex); - img->bDisplayLock = 0; + img->display_locked = 0; - if (!img->bDecoderLock) + if (!img->decoder_locked) vo_append_to_img_buf_queue (this->free_img_buf_queue, img); pthread_mutex_unlock (&img->mutex); @@ -281,10 +281,10 @@ static void *video_out_loop (void *this_gen) { } pthread_mutex_lock (&img->mutex); - img->bDriverLock = 1; - if (!img->bDisplayLock) + img->driver_locked = 1; + if (!img->display_locked) xprintf (VERBOSE|VIDEO, "video_out: ALERT! frame was not locked for display queue\n"); - img->bDisplayLock = 0; + img->display_locked = 0; pthread_mutex_unlock (&img->mutex); xprintf (VERBOSE|VIDEO, "video_out : passing to video driver, image with pts = %d\n", pts); @@ -318,10 +318,10 @@ static void *video_out_loop (void *this_gen) { img = vo_remove_from_img_buf_queue (this->display_img_buf_queue); pthread_mutex_lock (&img->mutex); - if (!img->bDecoderLock) + if (!img->decoder_locked) vo_append_to_img_buf_queue (this->free_img_buf_queue, img); - img->bDisplayLock = 0; + img->display_locked = 0; pthread_mutex_unlock (&img->mutex); img = this->display_img_buf_queue->first; @@ -373,9 +373,9 @@ static vo_frame_t *vo_get_frame (vo_instance_t *this, img = vo_remove_from_img_buf_queue (this->free_img_buf_queue); pthread_mutex_lock (&img->mutex); - img->bDisplayLock = 0; - img->bDecoderLock = 1; - img->bDriverLock = 0; + img->display_locked = 0; + img->decoder_locked = 1; + img->driver_locked = 0; img->width = width; img->height = height; img->ratio = ratio; @@ -427,9 +427,9 @@ static void vo_frame_displayed (vo_frame_t *img) { pthread_mutex_lock (&img->mutex); - img->bDriverLock = 0; + img->driver_locked = 0; - if (!img->bDecoderLock) { + if (!img->decoder_locked) { vo_append_to_img_buf_queue (img->instance->free_img_buf_queue, img); } @@ -439,9 +439,9 @@ static void vo_frame_displayed (vo_frame_t *img) { static void vo_frame_free (vo_frame_t *img) { pthread_mutex_lock (&img->mutex); - img->bDecoderLock = 0; + img->decoder_locked = 0; - if (!img->bDisplayLock && !img->bDriverLock ) { + if (!img->display_locked && !img->driver_locked ) { vo_append_to_img_buf_queue (img->instance->free_img_buf_queue, img); } @@ -466,6 +466,7 @@ static int vo_frame_draw (vo_frame_t *img) { printf ("video_out: got image %d. vpts for picture is %d (pts was %d)\n", img, pic_vpts, img->PTS); */ + img->PTS = pic_vpts; this->num_frames_delivered++; @@ -485,18 +486,22 @@ static int vo_frame_draw (vo_frame_t *img) { this->num_frames_discarded++; xprintf (VERBOSE|VIDEO, "vo_frame_draw: rejected, %d frames to skip\n", frames_to_skip); + /* printf ("vo_frame_draw: rejected, %d frames to skip\n", frames_to_skip); */ + pthread_mutex_lock (&img->mutex); - img->bDisplayLock = 0; + img->display_locked = 0; pthread_mutex_unlock (&img->mutex); vo_frame_displayed (img); + this->last_frame = img; + return frames_to_skip; } } /* else: we are probably in precaching mode */ - if (!img->bFrameBad) { + if (!img->bad_frame) { /* * put frame into FIFO-Buffer */ @@ -506,7 +511,7 @@ static int vo_frame_draw (vo_frame_t *img) { this->last_frame = img; pthread_mutex_lock (&img->mutex); - img->bDisplayLock = 1; + img->display_locked = 1; pthread_mutex_unlock (&img->mutex); vo_append_to_img_buf_queue (this->display_img_buf_queue, img); @@ -515,7 +520,7 @@ static int vo_frame_draw (vo_frame_t *img) { this->num_frames_skipped++; pthread_mutex_lock (&img->mutex); - img->bDisplayLock = 0; + img->display_locked = 0; pthread_mutex_unlock (&img->mutex); vo_frame_displayed (img); diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index 1ec2d6147..087f177a3 100644 --- a/src/xine-engine/video_out.h +++ b/src/xine-engine/video_out.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out.h,v 1.20 2001/09/19 02:40:58 miguelfreitas Exp $ + * $Id: video_out.h,v 1.21 2001/09/26 01:18:19 guenter Exp $ * * * xine version of video_out.h @@ -60,19 +60,17 @@ struct vo_frame_s { struct vo_frame_s *next; uint32_t PTS; - int bFrameBad; /* e.g. frame skipped or based on skipped frame */ + int bad_frame; /* e.g. frame skipped or based on skipped frame */ uint8_t *base[3]; - int nType; /* I, B or P frame */ + /* additional information to be able to duplicate frames: */ int width, height; int ratio, format, duration; - int bDisplayLock, bDecoderLock, bDriverLock; + int display_locked, decoder_locked, driver_locked; pthread_mutex_t mutex; /* so the various locks will be serialized */ - int nID; /* debugging purposes only */ - vo_instance_t *instance; /* diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 10aaf0c02..9adeb26f5 100644 --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_internal.h,v 1.44 2001/09/14 21:25:55 richwareham Exp $ + * $Id: xine_internal.h,v 1.45 2001/09/26 01:18:19 guenter Exp $ * */ @@ -162,8 +162,6 @@ struct xine_s { spu_decoder_t *spu_decoder_plugins[DECODER_PLUGIN_MAX]; int num_spu_decoder_plugins; spu_decoder_t *cur_spu_decoder_plugin; - uint32_t spu_track_map[50]; - int spu_track_map_entries; int spu_finished; int audio_channel; |