summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-09-26 01:18:19 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-09-26 01:18:19 +0000
commit105564c9ce5bea7587776e8cf39b2a3681b6d573 (patch)
tree7e0ea0f478d4022b3304441a68d800709f666ebe
parentf1f49a64af45856152c4ee9697f45d907647b406 (diff)
downloadxine-lib-105564c9ce5bea7587776e8cf39b2a3681b6d573.tar.gz
xine-lib-105564c9ce5bea7587776e8cf39b2a3681b6d573.tar.bz2
libmpeg2 cleanups, more tweaks for still image display, implemented BUF_CONTROL_SPU_CHANNEL, trying to wipe out last windows style variable names (bFrameBad for example)
CVS patchset: 697 CVS date: 2001/09/26 01:18:19
-rw-r--r--src/libffmpeg/xine_decoder.c6
-rw-r--r--src/libmpeg2/decode.c127
-rw-r--r--src/libmpeg2/header.c5
-rw-r--r--src/libmpeg2/slice.c48
-rw-r--r--src/libvfill/xine_decoder.c2
-rw-r--r--src/libw32dll/w32codec.c6
-rw-r--r--src/xine-engine/video_decoder.c12
-rw-r--r--src/xine-engine/video_out.c53
-rw-r--r--src/xine-engine/video_out.h10
-rw-r--r--src/xine-engine/xine_internal.h4
10 files changed, 117 insertions, 156 deletions
diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c
index 45823745a..4ff2d3a28 100644
--- a/src/libffmpeg/xine_decoder.c
+++ b/src/libffmpeg/xine_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: xine_decoder.c,v 1.14 2001/09/23 17:44:33 jkeil Exp $
+ * $Id: xine_decoder.c,v 1.15 2001/09/26 01:18:19 guenter Exp $
*
* xine decoder plugin using ffmpeg
*
@@ -229,9 +229,9 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
img->PTS = buf->PTS;
if (len<0) {
printf ("ffmpeg: error decompressing frame\n");
- img->bFrameBad = 1;
+ img->bad_frame = 1;
} else {
- img->bFrameBad = 0;
+ img->bad_frame = 0;
dy = img->base[0];
du = img->base[1];
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c
index 48f5bf42c..96e7a86e2 100644
--- a/src/libmpeg2/decode.c
+++ b/src/libmpeg2/decode.c
@@ -76,17 +76,19 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code,
picture_t * picture;
int is_frame_done;
- /* printf ("libmpeg2: parse_chunk 0x%02x\n", code); */
+ /*
+ printf ("libmpeg2: parse_chunk 0x%02x\n", code);
+ */
/* wait for sequence_header_code */
if (mpeg2dec->is_sequence_needed) {
if (code != 0xb3) {
- /* printf ("libmpeg2: waiting for sequence header\n"); */
+ /* printf ("libmpeg2: waiting for sequence header\n"); */
mpeg2dec->pts = 0;
return 0;
}
} else if (mpeg2dec->is_frame_needed && (code != 0x00)) {
- /* printf ("libmpeg2: waiting for frame start\n"); */
+ /* printf ("libmpeg2: waiting for frame start\n"); */
mpeg2dec->pts = 0;
return 0;
}
@@ -102,14 +104,14 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code,
if ( picture->current_frame && ((picture->picture_structure == FRAME_PICTURE) ||
(picture->second_field)) ) {
- picture->current_frame->bFrameBad |= mpeg2dec->drop_frame;
+ picture->current_frame->bad_frame |= mpeg2dec->drop_frame;
-#if 0
-fprintf (stderr, "type %s: %s\n",
- picture->picture_coding_type == I_TYPE ? "I" :
- picture->picture_coding_type == P_TYPE ? "P" : "B",
- picture->current_frame->bFrameBad ? "BAD" : "good");
-#endif
+#if 0
+ printf ("type %s: %s\n",
+ picture->picture_coding_type == I_TYPE ? "I" :
+ picture->picture_coding_type == P_TYPE ? "P" : "B",
+ picture->current_frame->bad_frame ? "BAD" : "good");
+#endif
if (picture->picture_coding_type == B_TYPE) {
if (picture->mpeg1)
picture->current_frame->PTS = 0;
@@ -117,7 +119,7 @@ fprintf (stderr, "type %s: %s\n",
picture->current_frame->free (picture->current_frame);
picture->current_frame = NULL;
picture->throwaway_frame = NULL;
- } else {
+ } else if (picture->forward_reference_frame) {
mpeg2dec->frames_to_drop = picture->forward_reference_frame->draw (picture->forward_reference_frame);
}
@@ -148,8 +150,8 @@ fprintf (stderr, "type %s: %s\n",
if (mpeg2dec->frames_to_drop>1) {
mpeg2dec->drop_frame = 1;
- } else if (picture->forward_reference_frame->bFrameBad
- || picture->backward_reference_frame->bFrameBad) {
+ } else if (!picture->forward_reference_frame || picture->forward_reference_frame->bad_frame
+ || !picture->backward_reference_frame || picture->backward_reference_frame->bad_frame) {
mpeg2dec->drop_frame = 1;
}
break;
@@ -158,16 +160,17 @@ fprintf (stderr, "type %s: %s\n",
if (mpeg2dec->frames_to_drop>2) {
mpeg2dec->drop_frame = 1;
- } else if (picture->backward_reference_frame->bFrameBad) {
+ } else if (!picture->backward_reference_frame || picture->backward_reference_frame->bad_frame) {
mpeg2dec->drop_frame = 1;
}
break;
case I_TYPE:
-
+ /*
if (mpeg2dec->frames_to_drop>4) {
mpeg2dec->drop_frame = 1;
}
+ */
break;
}
}
@@ -176,7 +179,7 @@ fprintf (stderr, "type %s: %s\n",
case 0xb3: /* sequence_header_code */
if (header_process_sequence_header (picture, buffer)) {
- fprintf (stderr, "bad sequence header\n");
+ printf ("libmpeg2: bad sequence header\n");
/* exit (1); */
} else if (mpeg2dec->is_sequence_needed
|| (picture->frame_width != picture->coded_picture_width)
@@ -185,7 +188,6 @@ fprintf (stderr, "type %s: %s\n",
printf ("mpeg2dec: frame size has changed to from %d x %d to %d x %d\n",
picture->frame_width, picture->frame_height,
picture->coded_picture_width, picture->coded_picture_height);
- fflush(stdout);
if (picture->forward_reference_frame)
picture->forward_reference_frame->free (picture->forward_reference_frame);
@@ -193,29 +195,11 @@ fprintf (stderr, "type %s: %s\n",
if (picture->backward_reference_frame)
picture->backward_reference_frame->free (picture->backward_reference_frame);
- printf ("mpeg2dec: old frames freed.\n"); fflush (stdout);
+ printf ("mpeg2dec: old frames freed.\n");
mpeg2dec->is_sequence_needed = 0;
- picture->forward_reference_frame =
- mpeg2dec->output->get_frame (mpeg2dec->output,
- picture->coded_picture_width,
- picture->coded_picture_height,
- picture->aspect_ratio_information,
- IMGFMT_YV12,
- picture->frame_duration,
- VO_PREDICTION_FLAG | VO_BOTH_FIELDS);
- picture->forward_reference_frame->PTS = 0;
- picture->forward_reference_frame->bFrameBad = 1;
- picture->backward_reference_frame =
- mpeg2dec->output->get_frame (mpeg2dec->output,
- picture->coded_picture_width,
- picture->coded_picture_height,
- picture->aspect_ratio_information,
- IMGFMT_YV12,
- picture->frame_duration,
- VO_PREDICTION_FLAG | VO_BOTH_FIELDS);
- picture->backward_reference_frame->PTS = 0;
- picture->backward_reference_frame->bFrameBad = 1;
+ picture->forward_reference_frame = NULL;
+ picture->backward_reference_frame = NULL;
picture->frame_width = picture->coded_picture_width;
picture->frame_height = picture->coded_picture_height;
@@ -264,13 +248,14 @@ fprintf (stderr, "type %s: %s\n",
IMGFMT_YV12,
picture->frame_duration,
(VO_PREDICTION_FLAG | picture->picture_structure));
- picture->forward_reference_frame->free (picture->forward_reference_frame);
+ if (picture->forward_reference_frame)
+ picture->forward_reference_frame->free (picture->forward_reference_frame);
picture->forward_reference_frame =
picture->backward_reference_frame;
picture->backward_reference_frame = picture->current_frame;
}
- picture->current_frame->bFrameBad = 0;
+ picture->current_frame->bad_frame = 0;
picture->current_frame->PTS = mpeg2dec->pts;
mpeg2dec->pts = 0;
}
@@ -377,37 +362,27 @@ void mpeg2_close (mpeg2dec_t * mpeg2dec)
}
*/
- /* Ensure that the last decoded frame is drawn */
- if(!picture->current_frame)
- return;
- picture->current_frame->bFrameBad |= mpeg2dec->drop_frame;
-
- if (picture->picture_coding_type == B_TYPE) {
- if (picture->mpeg1)
- picture->current_frame->PTS = 0;
- mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame);
- picture->current_frame->free (picture->current_frame);
- picture->current_frame = NULL;
- picture->throwaway_frame = NULL;
- } else {
- mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame);
+ if (picture->forward_reference_frame) {
+ printf ("libmpeg2: blasting out forward reference frame on close\n");
+ picture->forward_reference_frame->PTS = 0;
+ picture->forward_reference_frame->bad_frame = 0;
+ picture->forward_reference_frame->draw (picture->forward_reference_frame);
+ picture->forward_reference_frame->free (picture->forward_reference_frame);
}
- if (picture->throwaway_frame)
- {
- picture->throwaway_frame->displayed (picture->throwaway_frame);
+ if (picture->throwaway_frame) {
+ printf ("libmpeg2: blasting out throwaway frame on close\n");
+ picture->throwaway_frame->PTS = 0;
+ picture->throwaway_frame->bad_frame = 0;
+ picture->throwaway_frame->draw (picture->throwaway_frame);
picture->throwaway_frame->free (picture->throwaway_frame);
}
- if (picture->forward_reference_frame)
- {
- picture->forward_reference_frame->displayed (picture->forward_reference_frame);
- picture->forward_reference_frame->free (picture->forward_reference_frame);
- }
-
- if (picture->backward_reference_frame)
- {
- picture->backward_reference_frame->displayed (picture->backward_reference_frame);
+ if (picture->backward_reference_frame) {
+ printf ("libmpeg2: blasting out backward reference frame on close\n");
+ picture->backward_reference_frame->PTS = 0;
+ picture->backward_reference_frame->bad_frame = 0;
+ picture->backward_reference_frame->draw (picture->backward_reference_frame);
picture->backward_reference_frame->free (picture->backward_reference_frame);
}
@@ -445,26 +420,6 @@ void mpeg2_find_sequence_header (mpeg2dec_t * mpeg2dec,
if (mpeg2dec->is_sequence_needed) {
mpeg2dec->is_sequence_needed = 0;
- picture->forward_reference_frame =
- mpeg2dec->output->get_frame (mpeg2dec->output,
- picture->coded_picture_width,
- picture->coded_picture_height,
- picture->aspect_ratio_information,
- IMGFMT_YV12,
- picture->frame_duration,
- VO_PREDICTION_FLAG | VO_BOTH_FIELDS);
- picture->forward_reference_frame->PTS = 0;
- picture->forward_reference_frame->bFrameBad = 1;
- picture->backward_reference_frame =
- mpeg2dec->output->get_frame (mpeg2dec->output,
- picture->coded_picture_width,
- picture->coded_picture_height,
- picture->aspect_ratio_information,
- IMGFMT_YV12,
- picture->frame_duration,
- VO_PREDICTION_FLAG | VO_BOTH_FIELDS);
- picture->backward_reference_frame->PTS = 0;
- picture->backward_reference_frame->bFrameBad = 1;
picture->frame_width = picture->coded_picture_width;
picture->frame_height = picture->coded_picture_height;
diff --git a/src/libmpeg2/header.c b/src/libmpeg2/header.c
index cc2bf4022..9c4ac36f0 100644
--- a/src/libmpeg2/header.c
+++ b/src/libmpeg2/header.c
@@ -179,6 +179,11 @@ static int header_process_sequence_extension (picture_t * picture,
picture->coded_picture_height =
(picture->coded_picture_height + 31) & ~31;
+ /*
+ printf ("libmpeg2: sequence extension+5 : %08x (%d)\n",
+ buffer[5], buffer[5] % 0x80);
+ */
+
/* MPEG1 - for testing only */
picture->mpeg1 = 0;
diff --git a/src/libmpeg2/slice.c b/src/libmpeg2/slice.c
index 0207425df..4abdf8a4a 100644
--- a/src/libmpeg2/slice.c
+++ b/src/libmpeg2/slice.c
@@ -1520,42 +1520,44 @@ void slice_process (picture_t * picture, uint8_t code, uint8_t * buffer)
offset = (code - 1) * stride * 4;
picture->v_offset = (code - 1) * 16;
- forward_ref[0] = picture->forward_reference_frame->base;
- if (picture->picture_structure != FRAME_PICTURE) {
+ if (picture->forward_reference_frame) {
+ forward_ref[0] = picture->forward_reference_frame->base;
+ if (picture->picture_structure != FRAME_PICTURE) {
forward_ref[1] = picture->forward_reference_frame->base;
offset <<= 1;
picture->current_field = (picture->picture_structure == BOTTOM_FIELD);
if ((picture->second_field) &&
(picture->picture_coding_type != B_TYPE))
- forward_ref[picture->picture_structure == TOP_FIELD] =
- picture->current_frame->base;
-
+ forward_ref[picture->picture_structure == TOP_FIELD] =
+ picture->current_frame->base;
+
picture->f_motion.ref[1][0] = forward_ref[1][0] + stride;
picture->f_motion.ref[1][1] = forward_ref[1][1] + (stride >> 1);
picture->f_motion.ref[1][2] = forward_ref[1][2] + (stride >> 1);
-
+
picture->b_motion.ref[1][0] =
- picture->backward_reference_frame->base[0] + stride;
+ picture->backward_reference_frame->base[0] + stride;
picture->b_motion.ref[1][1] =
- picture->backward_reference_frame->base[1] + (stride >> 1);
+ picture->backward_reference_frame->base[1] + (stride >> 1);
picture->b_motion.ref[1][2] =
- picture->backward_reference_frame->base[2] + (stride >> 1);
+ picture->backward_reference_frame->base[2] + (stride >> 1);
+ }
+
+ picture->f_motion.ref[0][0] = forward_ref[0][0];
+ picture->f_motion.ref[0][1] = forward_ref[0][1];
+ picture->f_motion.ref[0][2] = forward_ref[0][2];
+
+ picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
+ picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
+
+ picture->b_motion.ref[0][0] = picture->backward_reference_frame->base[0];
+ picture->b_motion.ref[0][1] = picture->backward_reference_frame->base[1];
+ picture->b_motion.ref[0][2] = picture->backward_reference_frame->base[2];
+
+ picture->b_motion.pmv[0][0] = picture->b_motion.pmv[0][1] = 0;
+ picture->b_motion.pmv[1][0] = picture->b_motion.pmv[1][1] = 0;
}
- picture->f_motion.ref[0][0] = forward_ref[0][0];
- picture->f_motion.ref[0][1] = forward_ref[0][1];
- picture->f_motion.ref[0][2] = forward_ref[0][2];
-
- picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
- picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
-
- picture->b_motion.ref[0][0] = picture->backward_reference_frame->base[0];
- picture->b_motion.ref[0][1] = picture->backward_reference_frame->base[1];
- picture->b_motion.ref[0][2] = picture->backward_reference_frame->base[2];
-
- picture->b_motion.pmv[0][0] = picture->b_motion.pmv[0][1] = 0;
- picture->b_motion.pmv[1][0] = picture->b_motion.pmv[1][1] = 0;
-
if ((picture->current_frame->copy) &&
(picture->picture_coding_type == B_TYPE))
offset = 0;
diff --git a/src/libvfill/xine_decoder.c b/src/libvfill/xine_decoder.c
index 13693a6dd..b934b8a92 100644
--- a/src/libvfill/xine_decoder.c
+++ b/src/libvfill/xine_decoder.c
@@ -83,7 +83,7 @@ static void videofill_decode_data (video_decoder_t *this_gen, buf_element_t *buf
memcpy(img->base[2], last_img->base[2], image_size >> 2);
img->PTS = 0;
- img->bFrameBad = 0;
+ img->bad_frame = 0;
img->draw(img);
img->free(img);
diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c
index 60047b6ca..78974e26a 100644
--- a/src/libw32dll/w32codec.c
+++ b/src/libw32dll/w32codec.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: w32codec.c,v 1.29 2001/09/20 11:02:45 jkeil Exp $
+ * $Id: w32codec.c,v 1.30 2001/09/26 01:18:19 guenter Exp $
*
* routines for using w32 codecs
*
@@ -480,9 +480,9 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
img->PTS = buf->PTS;
if(ret) {
printf("Error decompressing frame, err=%ld\n", (long)ret);
- img->bFrameBad = 1;
+ img->bad_frame = 1;
} else
- img->bFrameBad = 0;
+ img->bad_frame = 0;
if (img->copy) {
int height = abs(this->o_bih.biHeight);
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;