mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
avfvideosrc: Only use the duration of the sample if it is valid
This commit is contained in:
parent
c98348c141
commit
31f59cb344
1 changed files with 4 additions and 2 deletions
|
@ -908,8 +908,10 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
||||||
if (CMSampleBufferGetOutputSampleTimingInfoArray(sbuf, 1, &time_info, &num_timings) == noErr) {
|
if (CMSampleBufferGetOutputSampleTimingInfoArray(sbuf, 1, &time_info, &num_timings) == noErr) {
|
||||||
timestamp = gst_util_uint64_scale (GST_SECOND,
|
timestamp = gst_util_uint64_scale (GST_SECOND,
|
||||||
time_info.presentationTimeStamp.value, time_info.presentationTimeStamp.timescale);
|
time_info.presentationTimeStamp.value, time_info.presentationTimeStamp.timescale);
|
||||||
duration = gst_util_uint64_scale (GST_SECOND,
|
|
||||||
time_info.duration.value, time_info.duration.timescale);
|
if (CMTIME_IS_VALID (time_info.duration) && time_info.duration.timescale != 0)
|
||||||
|
duration = gst_util_uint64_scale (GST_SECOND,
|
||||||
|
time_info.duration.value, time_info.duration.timescale);
|
||||||
|
|
||||||
now = CMClockGetTime(inputClock);
|
now = CMClockGetTime(inputClock);
|
||||||
inputClockNow = gst_util_uint64_scale (GST_SECOND,
|
inputClockNow = gst_util_uint64_scale (GST_SECOND,
|
||||||
|
|
Loading…
Reference in a new issue