From 3826d6f0d8c532c9da7613fe51223f580ece917c Mon Sep 17 00:00:00 2001 From: Julian Scheel Date: Tue, 12 Jan 2010 20:44:25 +0100 Subject: always draw still images. a still image is detected by the immediate following of an end of sequence mark, so that it is safe to remove backward references after decoding it. this will make the drawing logic work and draw the picture actually this fixed dvd menus with still images in background which were not always drawn --- src/video_dec/libvdpau/vdpau_mpeg12.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/video_dec/libvdpau/vdpau_mpeg12.c b/src/video_dec/libvdpau/vdpau_mpeg12.c index 09399ac3b..1b53b9cbe 100644 --- a/src/video_dec/libvdpau/vdpau_mpeg12.c +++ b/src/video_dec/libvdpau/vdpau_mpeg12.c @@ -660,7 +660,7 @@ static void decode_render( vdpau_mpeg12_decoder_t *vd, vdpau_accel_t *accel ) -static void decode_picture( vdpau_mpeg12_decoder_t *vd ) +static void decode_picture( vdpau_mpeg12_decoder_t *vd, uint8_t end_of_sequence ) { sequence_t *seq = (sequence_t*)&vd->sequence; picture_t *pic = (picture_t*)&seq->picture; @@ -740,6 +740,12 @@ static void decode_picture( vdpau_mpeg12_decoder_t *vd ) img->bad_frame = 0; img->duration = seq->video_step; + if ( end_of_sequence ) { + if ( seq->backward_ref ) + seq->backward_ref->free( seq->backward_ref ); + seq->backward_ref = NULL; + } + /* trying to deal with (french) buggy streams that randomly set bottom_field_first while stream is top_field_first. So we assume that when top_field_first is set one time, the stream _is_ top_field_first. */ @@ -813,7 +819,7 @@ static void vdpau_mpeg12_decode_data (video_decoder_t *this_gen, buf_element_t * } else { if ( parse_code( this, seq->buf+seq->start, seq->bufseek-seq->start ) ) { - decode_picture( this ); + decode_picture( this, 0 ); parse_code( this, seq->buf+seq->start, seq->bufseek-seq->start ); } uint8_t *tmp = (uint8_t*)malloc(seq->bufsize); @@ -831,7 +837,7 @@ static void vdpau_mpeg12_decode_data (video_decoder_t *this_gen, buf_element_t * /* still image detection -- don't wait for further data if buffer ends in sequence end code */ if (seq->start >= 0 && seq->buf[seq->start + 3] == sequence_end_code) { if (parse_code(this, seq->buf+seq->start, 4)) { - decode_picture(this); + decode_picture(this, 1); parse_code(this, seq->buf+seq->start, 4); } seq->start = -1; -- cgit v1.2.3