diff options
author | Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com> | 2009-04-27 21:30:59 +0200 |
---|---|---|
committer | Jan Schmidt <thaytan@noraisin.net> | 2009-06-20 15:21:34 +0100 |
commit | 3a7a2af1faf00ec3c2cc47fb03dfc01c9dab9eed (patch) | |
tree | 4b6fbce871c68be6470c0b1f69766fe57fe20e74 /sys | |
parent | 66231a619a2963551102a66c6afe177b8cd0491f (diff) | |
download | gst-plugins-bad-3a7a2af1faf00ec3c2cc47fb03dfc01c9dab9eed.tar.gz gst-plugins-bad-3a7a2af1faf00ec3c2cc47fb03dfc01c9dab9eed.tar.bz2 gst-plugins-bad-3a7a2af1faf00ec3c2cc47fb03dfc01c9dab9eed.zip |
vdpaumpegdec: drop frames if we haven't got an I_FRAME yet
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vdpau/gstvdpmpegdecoder.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/vdpau/gstvdpmpegdecoder.c b/sys/vdpau/gstvdpmpegdecoder.c index 1f15feaf..1a8402e4 100644 --- a/sys/vdpau/gstvdpmpegdecoder.c +++ b/sys/vdpau/gstvdpmpegdecoder.c @@ -325,10 +325,14 @@ gst_vdp_mpeg_decoder_parse_picture (GstVdpMpegDecoder * mpeg_dec, mpeg_dec->vdp_info.picture_coding_type = pic_hdr.pic_type; - if (pic_hdr.pic_type == I_FRAME && - 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; + if (pic_hdr.pic_type == I_FRAME) { + 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; + } + } else if (mpeg_dec->vdp_info.forward_reference == VDP_INVALID_HANDLE) { + GST_DEBUG_OBJECT (mpeg_dec, "Drop frame since we've got no I_FRAME yet"); + return FALSE; } if (mpeg_dec->version == 1) { @@ -439,7 +443,9 @@ gst_vdp_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer) case MPEG_PACKET_PICTURE: GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_PICTURE"); - gst_vdp_mpeg_decoder_parse_picture (mpeg_dec, packet_start, packet_end); + if (!gst_vdp_mpeg_decoder_parse_picture (mpeg_dec, packet_start, + packet_end)) + return GST_FLOW_OK; break; case MPEG_PACKET_SEQUENCE: GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_SEQUENCE"); |