diff options
author | Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com> | 2009-04-16 22:30:27 +0200 |
---|---|---|
committer | Jan Schmidt <thaytan@noraisin.net> | 2009-06-20 15:21:30 +0100 |
commit | a168fdc1d3dfa013c4b381dbe3914564ac79b444 (patch) | |
tree | db6816689f3e77e4228ee187dfe99f0fa7c500f0 /sys/vdpau | |
parent | da191134a1a66de4b5a591a5dea29dd4c0d8e92c (diff) | |
download | gst-plugins-bad-a168fdc1d3dfa013c4b381dbe3914564ac79b444.tar.gz gst-plugins-bad-a168fdc1d3dfa013c4b381dbe3914564ac79b444.tar.bz2 gst-plugins-bad-a168fdc1d3dfa013c4b381dbe3914564ac79b444.zip |
vdpaumpegdec: more B_FRAME work
Diffstat (limited to 'sys/vdpau')
-rw-r--r-- | sys/vdpau/gstvdpmpegdecoder.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/vdpau/gstvdpmpegdecoder.c b/sys/vdpau/gstvdpmpegdecoder.c index d2ec7fd1..7c134afa 100644 --- a/sys/vdpau/gstvdpmpegdecoder.c +++ b/sys/vdpau/gstvdpmpegdecoder.c @@ -157,6 +157,8 @@ gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec) /* unset forward_reference since next frame must be an I_FRAME */ mpeg_dec->vdp_info.forward_reference = VDP_INVALID_HANDLE; + mpeg_dec->vdp_info.slice_count = 0; + return GST_FLOW_OK; } @@ -181,11 +183,6 @@ gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec) ("Error returned from vdpau was: %s", device->vdp_get_error_string (status))); - if (mpeg_dec->vdp_info.forward_reference != VDP_INVALID_HANDLE) { - gst_buffer_unref (mpeg_dec->f_buffer); - mpeg_dec->vdp_info.forward_reference = VDP_INVALID_HANDLE; - } - gst_buffer_unref (GST_BUFFER (outbuf)); return GST_FLOW_ERROR; @@ -197,7 +194,9 @@ gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec) b_outbuf = gst_vdp_video_buffer_new (dec->device, VDP_CHROMA_TYPE_420, dec->width, dec->height); - mpeg_dec->b_vdp_info.backward_reference = surface; + mpeg_dec->b_vdp_info.backward_reference = + mpeg_dec->b_vdp_info.forward_reference; + mpeg_dec->b_vdp_info.forward_reference = surface; vbit[0].struct_version = VDP_BITSTREAM_BUFFER_VERSION; vbit[0].bitstream = GST_BUFFER_DATA (mpeg_dec->b_buffer); vbit[0].bitstream_bytes = GST_BUFFER_SIZE (mpeg_dec->b_buffer); @@ -212,12 +211,12 @@ gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec) ("Could not decode B_FRAME"), ("Error returned from vdpau was: %s", device->vdp_get_error_string (status))); - - if (mpeg_dec->b_vdp_info.forward_reference != VDP_INVALID_HANDLE) - gst_buffer_unref (mpeg_dec->f_buffer); } gst_vdp_decoder_push_video_buffer (GST_VDPAU_DECODER (mpeg_dec), b_outbuf); + + if (mpeg_dec->b_vdp_info.forward_reference != VDP_INVALID_HANDLE) + gst_buffer_unref (mpeg_dec->f_buffer); } gst_buffer_ref (GST_BUFFER (outbuf)); |