mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
msdkdec: Update decoding pts
Update frame pts before calling gst_video_decoder_finish_frame, or frames may be lost when transcoding in specific stream Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3449>
This commit is contained in:
parent
4c3bb001f5
commit
66087b6276
1 changed files with 5 additions and 0 deletions
|
@ -58,6 +58,9 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
#define GST_TO_MFX_TIME(time) ((time) == GST_CLOCK_TIME_NONE ? \
|
#define GST_TO_MFX_TIME(time) ((time) == GST_CLOCK_TIME_NONE ? \
|
||||||
MFX_TIMESTAMP_UNKNOWN : gst_util_uint64_scale_round ((time), 9, 100000))
|
MFX_TIMESTAMP_UNKNOWN : gst_util_uint64_scale_round ((time), 9, 100000))
|
||||||
|
|
||||||
|
#define MFX_TO_GST_TIME(time) ((time) == MFX_TIMESTAMP_UNKNOWN ? \
|
||||||
|
GST_CLOCK_TIME_NONE : gst_util_uint64_scale_round ((time), 100000, 9))
|
||||||
|
|
||||||
#define MFX_TIME_IS_VALID(time) ((time) != MFX_TIMESTAMP_UNKNOWN)
|
#define MFX_TIME_IS_VALID(time) ((time) != MFX_TIMESTAMP_UNKNOWN)
|
||||||
|
|
||||||
#define gst_msdkdec_parent_class parent_class
|
#define gst_msdkdec_parent_class parent_class
|
||||||
|
@ -944,6 +947,8 @@ gst_msdkdec_finish_task (GstMsdkDec * thiz, MsdkDecTask * task)
|
||||||
|
|
||||||
if (decode_only)
|
if (decode_only)
|
||||||
GST_VIDEO_CODEC_FRAME_SET_DECODE_ONLY (frame);
|
GST_VIDEO_CODEC_FRAME_SET_DECODE_ONLY (frame);
|
||||||
|
|
||||||
|
frame->pts = MFX_TO_GST_TIME (pts);
|
||||||
flow = gst_video_decoder_finish_frame (decoder, frame);
|
flow = gst_video_decoder_finish_frame (decoder, frame);
|
||||||
if (flow == GST_FLOW_ERROR)
|
if (flow == GST_FLOW_ERROR)
|
||||||
GST_ERROR_OBJECT (thiz, "Failed to finish frame");
|
GST_ERROR_OBJECT (thiz, "Failed to finish frame");
|
||||||
|
|
Loading…
Reference in a new issue