From 5956df5338d0f3f3763bd8aa9e0e4b7b501a8469 Mon Sep 17 00:00:00 2001 From: Carl-Anton Ingmarsson Date: Fri, 5 Jun 2009 21:42:30 +0200 Subject: [PATCH] vdpaumpegdec: pass buffer size directly to gst_vdp_mpeg_decoder_decode --- sys/vdpau/gstvdpmpegdecoder.c | 8 ++++---- sys/vdpau/gstvdpmpegdecoder.h | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/vdpau/gstvdpmpegdecoder.c b/sys/vdpau/gstvdpmpegdecoder.c index da4f63ecd9..6968c34794 100644 --- a/sys/vdpau/gstvdpmpegdecoder.c +++ b/sys/vdpau/gstvdpmpegdecoder.c @@ -329,7 +329,7 @@ gst_vdp_mpeg_decoder_push_video_buffer (GstVdpMpegDecoder * mpeg_dec, static GstFlowReturn gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec, - GstClockTime timestamp) + GstClockTime timestamp, gint64 size) { VdpPictureInfoMPEG1Or2 *info; GstBuffer *buffer; @@ -367,7 +367,7 @@ gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec, GST_BUFFER_TIMESTAMP (outbuf) = timestamp; GST_BUFFER_DURATION (outbuf) = mpeg_dec->duration; GST_BUFFER_OFFSET (outbuf) = mpeg_dec->frame_nr; - GST_BUFFER_SIZE (outbuf) = mpeg_dec->size; + GST_BUFFER_SIZE (outbuf) = size; if (info->top_field_first) GST_BUFFER_FLAG_SET (outbuf, GST_VIDEO_BUFFER_TFF); @@ -608,7 +608,6 @@ gst_vdp_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer) gst_vdp_mpeg_decoder_flush (mpeg_dec); } - mpeg_dec->size = GST_BUFFER_SIZE (buffer); gst_vdp_mpeg_packetizer_init (&packetizer, buffer); while ((buf = gst_vdp_mpeg_packetizer_get_next_packet (&packetizer))) { GstBitReader b_reader = GST_BIT_READER_INIT_FROM_BUFFER (buf); @@ -676,7 +675,8 @@ gst_vdp_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer) } if (mpeg_dec->vdp_info.slice_count > 0) - ret = gst_vdp_mpeg_decoder_decode (mpeg_dec, GST_BUFFER_TIMESTAMP (buffer)); + ret = gst_vdp_mpeg_decoder_decode (mpeg_dec, GST_BUFFER_TIMESTAMP (buffer), + GST_BUFFER_SIZE (buffer)); return ret; } diff --git a/sys/vdpau/gstvdpmpegdecoder.h b/sys/vdpau/gstvdpmpegdecoder.h index 3cd521baf6..e130086277 100644 --- a/sys/vdpau/gstvdpmpegdecoder.h +++ b/sys/vdpau/gstvdpmpegdecoder.h @@ -59,7 +59,6 @@ struct _GstVdpMpegDecoder /* currently decoded frame info */ GstAdapter *adapter; VdpPictureInfoMPEG1Or2 vdp_info; - guint64 size; guint64 frame_nr; GstClockTime duration;