diff options
author | Reinhard Nißl <rnissl@gmx.de> | 2011-01-20 21:14:52 +0100 |
---|---|---|
committer | Reinhard Nißl <rnissl@gmx.de> | 2011-01-20 21:14:52 +0100 |
commit | ae0af713c1bd385aa2d6aa3cbe94ae41c124b63e (patch) | |
tree | ad4715b8eabf11e8d4cdcdd21ef92fb47490eeca | |
parent | dcfe00dfc61454ac2c13dd126355237e044b0254 (diff) | |
download | xine-lib-ae0af713c1bd385aa2d6aa3cbe94ae41c124b63e.tar.gz xine-lib-ae0af713c1bd385aa2d6aa3cbe94ae41c124b63e.tar.bz2 |
Fix pts handling after introduction of picture_ready()
Transfer of seq_pts to img->pts takes now place at picture header of next
image in decoding order. So far, seq_pts was set to cur_pts at sequence
header and picture header. Hence, img->pts was incorrectly set to pts of
next image in decoding order.
Setting seq_pts only in picture header after call of picture_ready() keeps
the correct pts in seq_pts until it has been transfered to img->pts.
Furthermore, cur_pts of second field must be ignored as we put both fields
into the same image so the image is due at pts of first field.
-rw-r--r-- | src/video_dec/libvdpau/vdpau_mpeg12.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/video_dec/libvdpau/vdpau_mpeg12.c b/src/video_dec/libvdpau/vdpau_mpeg12.c index e0a7bcd67..d771fd364 100644 --- a/src/video_dec/libvdpau/vdpau_mpeg12.c +++ b/src/video_dec/libvdpau/vdpau_mpeg12.c @@ -257,11 +257,6 @@ static void sequence_header( vdpau_mpeg12_decoder_t *this_gen, uint8_t *buf, int int i, j; - if ( sequence->cur_pts ) { - sequence->seq_pts = sequence->cur_pts; - sequence->cur_pts = 0; - } - bits_reader_set( &sequence->br, buf, len ); sequence->coded_width = read_bits( &sequence->br, 12 ); lprintf( "coded_width: %d\n", sequence->coded_width ); @@ -351,11 +346,6 @@ static void picture_header( vdpau_mpeg12_decoder_t *this_gen, uint8_t *buf, int { sequence_t *sequence = (sequence_t*)&this_gen->sequence; - if ( sequence->cur_pts ) { - sequence->seq_pts = sequence->cur_pts; - sequence->cur_pts = 0; - } - if ( sequence->profile==VDP_DECODER_PROFILE_MPEG1 ) sequence->picture.vdp_infos.picture_structure = PICTURE_FRAME; @@ -372,6 +362,14 @@ static void picture_header( vdpau_mpeg12_decoder_t *this_gen, uint8_t *buf, int else if ( sequence->picture.vdp_infos.picture_structure ) { infos = &sequence->picture.vdp_infos2; sequence->picture.slices_pos_top = sequence->picture.slices_pos; + + sequence->cur_pts = 0; /* ignore pts of second field */ + } + + /* take over pts for next issued image */ + if ( sequence->cur_pts ) { + sequence->seq_pts = sequence->cur_pts; + sequence->cur_pts = 0; } bits_reader_set( &sequence->br, buf, len ); |