mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:16:13 +00:00
vc1: fix presentation timestamps.
This commit is contained in:
parent
b5ab2e56a9
commit
7b1d784197
1 changed files with 12 additions and 3 deletions
|
@ -907,6 +907,7 @@ decode_frame(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
|
||||||
GstVaapiSlice *slice;
|
GstVaapiSlice *slice;
|
||||||
GstVaapiDecoderStatus status;
|
GstVaapiDecoderStatus status;
|
||||||
VASliceParameterBufferVC1 *slice_param;
|
VASliceParameterBufferVC1 *slice_param;
|
||||||
|
GstClockTime pts;
|
||||||
|
|
||||||
status = ensure_context(decoder);
|
status = ensure_context(decoder);
|
||||||
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) {
|
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;
|
return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Update presentation time */
|
||||||
|
pts = gst_vaapi_tsb_get_timestamp(priv->tsb);
|
||||||
|
picture->pts = pts;
|
||||||
|
|
||||||
/* Update reference pictures */
|
/* Update reference pictures */
|
||||||
if (GST_VAAPI_PICTURE_IS_REFERENCE(picture)) {
|
if (GST_VAAPI_PICTURE_IS_REFERENCE(picture)) {
|
||||||
if (priv->prev_picture) {
|
if (priv->prev_picture) {
|
||||||
|
@ -1106,6 +1111,8 @@ decode_buffer(GstVaapiDecoderVC1 *decoder, GstBuffer *buffer)
|
||||||
if (!buf && buf_size == 0)
|
if (!buf && buf_size == 0)
|
||||||
return decode_sequence_end(decoder);
|
return decode_sequence_end(decoder);
|
||||||
|
|
||||||
|
gst_vaapi_tsb_push(priv->tsb, buffer);
|
||||||
|
|
||||||
/* Assume demuxer sends out plain frames if codec-data */
|
/* Assume demuxer sends out plain frames if codec-data */
|
||||||
codec_data = GST_VAAPI_DECODER_CODEC_DATA(decoder);
|
codec_data = GST_VAAPI_DECODER_CODEC_DATA(decoder);
|
||||||
if (codec_data && codec_data != buffer) {
|
if (codec_data && codec_data != buffer) {
|
||||||
|
@ -1114,11 +1121,11 @@ decode_buffer(GstVaapiDecoderVC1 *decoder, GstBuffer *buffer)
|
||||||
ebdu.sc_offset = 0;
|
ebdu.sc_offset = 0;
|
||||||
ebdu.offset = 0;
|
ebdu.offset = 0;
|
||||||
ebdu.data = buf;
|
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) {
|
if (priv->sub_buffer) {
|
||||||
buffer = gst_buffer_merge(priv->sub_buffer, buffer);
|
buffer = gst_buffer_merge(priv->sub_buffer, buffer);
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
|
@ -1146,7 +1153,9 @@ decode_buffer(GstVaapiDecoderVC1 *decoder, GstBuffer *buffer)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ofs += ebdu.offset + ebdu.size;
|
ofs += ebdu.offset + ebdu.size;
|
||||||
|
gst_vaapi_tsb_pop(priv->tsb, ebdu.offset);
|
||||||
status = decode_ebdu(decoder, &ebdu);
|
status = decode_ebdu(decoder, &ebdu);
|
||||||
|
gst_vaapi_tsb_pop(priv->tsb, ebdu.size);
|
||||||
} while (status == GST_VAAPI_DECODER_STATUS_SUCCESS);
|
} while (status == GST_VAAPI_DECODER_STATUS_SUCCESS);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue