diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2011-10-07 11:12:33 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-01-16 11:40:51 +0100 |
commit | 7b1d7841977bdf416567f1e4ba934407ed11aa67 (patch) | |
tree | abd712cd4c74d2f7a0b66353dd279bd9e6f50cdc /gst-libs/gst/vaapi/gstvaapidecoder_vc1.c | |
parent | b5ab2e56a9afbaffa6350c83f284874a68acd45c (diff) |
vc1: fix presentation timestamps.
Diffstat (limited to 'gst-libs/gst/vaapi/gstvaapidecoder_vc1.c')
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder_vc1.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c b/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c index 829f5dfa..35fc75b4 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c @@ -907,6 +907,7 @@ decode_frame(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu) GstVaapiSlice *slice; GstVaapiDecoderStatus status; VASliceParameterBufferVC1 *slice_param; + GstClockTime pts; status = ensure_context(decoder); if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { @@ -968,6 +969,10 @@ decode_frame(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu) return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; } + /* Update presentation time */ + pts = gst_vaapi_tsb_get_timestamp(priv->tsb); + picture->pts = pts; + /* Update reference pictures */ if (GST_VAAPI_PICTURE_IS_REFERENCE(picture)) { if (priv->prev_picture) { @@ -1106,6 +1111,8 @@ decode_buffer(GstVaapiDecoderVC1 *decoder, GstBuffer *buffer) if (!buf && buf_size == 0) return decode_sequence_end(decoder); + gst_vaapi_tsb_push(priv->tsb, buffer); + /* Assume demuxer sends out plain frames if codec-data */ codec_data = GST_VAAPI_DECODER_CODEC_DATA(decoder); if (codec_data && codec_data != buffer) { @@ -1114,11 +1121,11 @@ decode_buffer(GstVaapiDecoderVC1 *decoder, GstBuffer *buffer) ebdu.sc_offset = 0; ebdu.offset = 0; ebdu.data = buf; - return decode_ebdu(decoder, &ebdu); + status = decode_ebdu(decoder, &ebdu); + gst_vaapi_tsb_pop(priv->tsb, buf_size); + return status; } - gst_vaapi_tsb_push(priv->tsb, buffer); - if (priv->sub_buffer) { buffer = gst_buffer_merge(priv->sub_buffer, buffer); if (!buffer) @@ -1146,7 +1153,9 @@ decode_buffer(GstVaapiDecoderVC1 *decoder, GstBuffer *buffer) break; ofs += ebdu.offset + ebdu.size; + gst_vaapi_tsb_pop(priv->tsb, ebdu.offset); status = decode_ebdu(decoder, &ebdu); + gst_vaapi_tsb_pop(priv->tsb, ebdu.size); } while (status == GST_VAAPI_DECODER_STATUS_SUCCESS); return status; } |