diff options
author | Dennis Bendlin <dennisbendlin@yahoo.de> | 2010-07-21 15:52:00 +0000 |
---|---|---|
committer | Dennis Bendlin <dennisbendlin@yahoo.de> | 2010-07-21 15:52:00 +0000 |
commit | 075ceb0f09469b507deb0d06d3cfa5c829a6661f (patch) | |
tree | 7f8583ed749e3be24f15667ec91d98e6a09be207 /src | |
parent | e9aaf9f1fb33de4222ae1eb35d28789f03a0ed2b (diff) | |
download | xine-lib-075ceb0f09469b507deb0d06d3cfa5c829a6661f.tar.gz xine-lib-075ceb0f09469b507deb0d06d3cfa5c829a6661f.tar.bz2 |
vdpau: update XINE_STREAM_INFO_FRAME_DURATION
--HG--
extra : rebase_source : 986f546343c08d288d44c3a9ea3a6d4309ace204
Diffstat (limited to 'src')
-rw-r--r-- | src/video_dec/libvdpau/vdpau_h264.c | 7 | ||||
-rw-r--r-- | src/video_dec/libvdpau/vdpau_mpeg12.c | 6 | ||||
-rw-r--r-- | src/video_dec/libvdpau/vdpau_vc1.c | 7 |
3 files changed, 17 insertions, 3 deletions
diff --git a/src/video_dec/libvdpau/vdpau_h264.c b/src/video_dec/libvdpau/vdpau_h264.c index 257f3b1a7..682a02e00 100644 --- a/src/video_dec/libvdpau/vdpau_h264.c +++ b/src/video_dec/libvdpau/vdpau_h264.c @@ -59,6 +59,7 @@ typedef struct vdpau_h264_decoder_s { /* these are traditional variables in a video decoder object */ uint64_t video_step; /* frame duration in pts units */ + uint64_t reported_video_step; /* frame duration in pts units */ int width; /* the width of a video frame */ int height; /* the height of a video frame */ @@ -365,7 +366,7 @@ static int vdpau_decoder_init(video_decoder_t *this_gen) _x_stream_info_set( this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, this->width ); _x_stream_info_set( this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, this->height ); _x_stream_info_set( this->stream, XINE_STREAM_INFO_VIDEO_RATIO, ((double)10000*this->ratio) ); - _x_stream_info_set( this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step ); + _x_stream_info_set( this->stream, XINE_STREAM_INFO_FRAME_DURATION, (this->reported_video_step = this->video_step) ); _x_meta_info_set_utf8( this->stream, XINE_META_INFO_VIDEOCODEC, "H264/AVC (vdpau)" ); xine_event_t event; xine_format_change_data_t data; @@ -703,6 +704,10 @@ static void vdpau_h264_decode_data (video_decoder_t *this_gen, _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step); } + if (this->video_step != this->reported_video_step){ + _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, (this->reported_video_step = this->video_step)); + } + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ this->have_frame_boundary_marks = 0; diff --git a/src/video_dec/libvdpau/vdpau_mpeg12.c b/src/video_dec/libvdpau/vdpau_mpeg12.c index f55b756b1..591474631 100644 --- a/src/video_dec/libvdpau/vdpau_mpeg12.c +++ b/src/video_dec/libvdpau/vdpau_mpeg12.c @@ -131,6 +131,7 @@ typedef struct { uint32_t coded_height; uint64_t video_step; /* frame duration in pts units */ + uint64_t reported_video_step; /* frame duration in pts units */ double ratio; VdpDecoderProfile profile; int chroma; @@ -288,6 +289,9 @@ static void sequence_header( vdpau_mpeg12_decoder_t *this_gen, uint8_t *buf, int case 7: sequence->video_step = 1525; break; /* 59.94.. */ case 8: sequence->video_step = 1509; break; /* 60 */ } + if (sequence->reported_video_step != sequence->video_step){ + _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_FRAME_DURATION, (sequence->reported_video_step = sequence->video_step) ); + } lprintf( "frame_rate: %d\n", fr ); int tmp; tmp = read_bits( &sequence->br, 18 ); @@ -328,7 +332,7 @@ static void sequence_header( vdpau_mpeg12_decoder_t *this_gen, uint8_t *buf, int _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_WIDTH, sequence->coded_width ); _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, sequence->coded_height ); _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_RATIO, ((double)10000*sequence->ratio) ); - _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_FRAME_DURATION, sequence->video_step ); + _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_FRAME_DURATION, (sequence->reported_video_step = sequence->video_step) ); _x_meta_info_set_utf8( this_gen->stream, XINE_META_INFO_VIDEOCODEC, "MPEG1/2 (vdpau)" ); xine_event_t event; xine_format_change_data_t data; diff --git a/src/video_dec/libvdpau/vdpau_vc1.c b/src/video_dec/libvdpau/vdpau_vc1.c index cfb55d32b..02545a714 100644 --- a/src/video_dec/libvdpau/vdpau_vc1.c +++ b/src/video_dec/libvdpau/vdpau_vc1.c @@ -119,6 +119,7 @@ typedef struct { uint32_t coded_height; uint64_t video_step; /* frame duration in pts units */ + uint64_t reported_video_step; /* frame duration in pts units */ double ratio; VdpDecoderProfile profile; @@ -227,7 +228,7 @@ static void update_metadata( vdpau_vc1_decoder_t *this_gen ) _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_WIDTH, sequence->coded_width ); _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, sequence->coded_height ); _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_RATIO, ((double)10000*sequence->ratio) ); - _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_FRAME_DURATION, sequence->video_step ); + _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_FRAME_DURATION, (sequence->reported_video_step = sequence->video_step) ); _x_meta_info_set_utf8( this_gen->stream, XINE_META_INFO_VIDEOCODEC, "VC1/WMV9 (vdpau)" ); xine_event_t event; xine_format_change_data_t data; @@ -909,6 +910,10 @@ static void vdpau_vc1_decode_data (video_decoder_t *this_gen, buf_element_t *buf _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->sequence.video_step); } } + + if (this->sequence.reported_video_step != this->sequence.video_step){ + _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, (this->sequence.reported_video_step = this->sequence.video_step)); + } if (buf->decoder_flags & BUF_FLAG_HEADER) { lprintf("BUF_FLAG_HEADER\n"); |