vtdec: Properly scale timestamps for the API and set invalid values

This commit is contained in:
Sebastian Dröge 2014-09-17 14:54:39 +03:00
parent d789246077
commit e4563ce6cf

View file

@ -455,9 +455,23 @@ cm_sample_buffer_from_gst_buffer (GstVtdec * vtdec, GstBuffer * buf)
goto block_error; goto block_error;
/* create a sample buffer, the CoreMedia equivalent of GstBuffer */ /* create a sample buffer, the CoreMedia equivalent of GstBuffer */
sample_timing.duration = CMTimeMake (GST_BUFFER_DURATION (buf), 1); if (GST_BUFFER_DURATION_IS_VALID (buf))
sample_timing.presentationTimeStamp = CMTimeMake (GST_BUFFER_PTS (buf), 1); sample_timing.duration = CMTimeMake (GST_BUFFER_DURATION (buf), GST_SECOND);
sample_timing.decodeTimeStamp = CMTimeMake (GST_BUFFER_DTS (buf), 1); else
sample_timing.duration = kCMTimeInvalid;
if (GST_BUFFER_PTS_IS_VALID (buf))
sample_timing.presentationTimeStamp =
CMTimeMake (GST_BUFFER_PTS (buf), GST_SECOND);
else
sample_timing.presentationTimeStamp = kCMTimeInvalid;
if (GST_BUFFER_DTS_IS_VALID (buf))
sample_timing.decodeTimeStamp =
CMTimeMake (GST_BUFFER_DTS (buf), GST_SECOND);
else
sample_timing.decodeTimeStamp = kCMTimeInvalid;
time_array[0] = sample_timing; time_array[0] = sample_timing;
status = status =