summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristophe Thommeret <hftom@free.fr>2009-09-28 15:00:51 +0100
committerChristophe Thommeret <hftom@free.fr>2009-09-28 15:00:51 +0100
commit9c38df222650505b673d70c5eedf7b51fc9f0b19 (patch)
treea1004e56e1b82c5a4283c4207f5be5a7b077147a /src
parent29150fd62b65fa758dc12b2304aed0211663fce2 (diff)
downloadxine-lib-9c38df222650505b673d70c5eedf7b51fc9f0b19.tar.gz
xine-lib-9c38df222650505b673d70c5eedf7b51fc9f0b19.tar.bz2
Try to deal with buggy top_field_first.
Diffstat (limited to 'src')
-rw-r--r--src/libvdpau/vdpau_mpeg12.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libvdpau/vdpau_mpeg12.c b/src/libvdpau/vdpau_mpeg12.c
index 4ef1f5c30..f3ad9a03c 100644
--- a/src/libvdpau/vdpau_mpeg12.c
+++ b/src/libvdpau/vdpau_mpeg12.c
@@ -131,6 +131,7 @@ typedef struct {
double ratio;
VdpDecoderProfile profile;
int chroma;
+ int top_field_first;
int have_header;
@@ -229,6 +230,7 @@ static void reset_sequence( sequence_t *sequence, int free_refs )
if ( sequence->backward_ref )
sequence->backward_ref->free( sequence->backward_ref );
sequence->backward_ref = NULL;
+ sequence->top_field_first = 0;
}
@@ -737,7 +739,14 @@ static void decode_picture( vdpau_mpeg12_decoder_t *vd )
seq->seq_pts = 0; /* reset */
img->bad_frame = 0;
img->duration = seq->video_step;
- img->top_field_first = pic->vdp_infos.top_field_first;
+
+ /* 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. */
+ //printf("pic->vdp_infos.top_field_first = %d\n", pic->vdp_infos.top_field_first);
+ if ( pic->vdp_infos.top_field_first )
+ seq->top_field_first = 1;
+ img->top_field_first = seq->top_field_first;
/* progressive_frame is unreliable with most mpeg2 streams */
if ( pic->vdp_infos.picture_structure!=PICTURE_FRAME )