From 757086e3fa0b034b1b9b145f65a0512acc21f4d2 Mon Sep 17 00:00:00 2001 From: Carl-Anton Ingmarsson Date: Fri, 5 Jun 2009 18:18:38 +0200 Subject: vdpaumpegdec: only set base duration once --- sys/vdpau/gstvdpmpegdecoder.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/vdpau/gstvdpmpegdecoder.c b/sys/vdpau/gstvdpmpegdecoder.c index db01527d..9475a948 100644 --- a/sys/vdpau/gstvdpmpegdecoder.c +++ b/sys/vdpau/gstvdpmpegdecoder.c @@ -251,6 +251,10 @@ gst_vdp_mpeg_decoder_set_caps (GstPad * pad, GstCaps * caps) gst_buffer_unref (buf); } + mpeg_dec->duration = + gst_util_uint64_scale (1, GST_SECOND * mpeg_dec->fps_d, + mpeg_dec->fps_n); + mpeg_dec->byterate = bitrate * 50; GST_DEBUG ("byterate: %" G_GINT64_FORMAT, mpeg_dec->byterate); } @@ -496,9 +500,6 @@ gst_vdp_mpeg_decoder_parse_picture (GstVdpMpegDecoder * mpeg_dec, memcpy (&mpeg_dec->vdp_info.f_code, &pic_hdr.f_code, 4); } - mpeg_dec->duration = gst_util_uint64_scale (1, GST_SECOND * mpeg_dec->fps_d, - mpeg_dec->fps_n); - mpeg_dec->frame_nr = mpeg_dec->gop_frame + pic_hdr.tsn; return TRUE; @@ -1025,13 +1026,12 @@ gst_vdp_mpeg_decoder_init (GstVdpMpegDecoder * mpeg_dec, mpeg_dec->display_name = NULL; mpeg_dec->adapter = gst_adapter_new (); - mpeg_dec->next_timestamp = 0; - mpeg_dec->device = NULL; mpeg_dec->decoder = VDP_INVALID_HANDLE; - gst_vdp_mpeg_decoder_init_info (&mpeg_dec->vdp_info); + mpeg_dec->vdp_info.forward_reference = VDP_INVALID_HANDLE; + mpeg_dec->vdp_info.backward_reference = VDP_INVALID_HANDLE; - gst_segment_init (&mpeg_dec->segment, GST_FORMAT_TIME); + gst_vdp_mpeg_decoder_reset (mpeg_dec); } static void -- cgit v1.2.1