MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / av_timecode_init_from_components

Function av_timecode_init_from_components

libavutil/timecode.c:211–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211int av_timecode_init_from_components(AVTimecode *tc, AVRational rate, int flags, int hh, int mm, int ss, int ff, void *log_ctx)
212{
213 int ret;
214 int64_t s;
215
216 memset(tc, 0, sizeof(*tc));
217 tc->flags = flags;
218 tc->rate = rate;
219 tc->fps = fps_from_frame_rate(rate);
220
221 ret = check_timecode(log_ctx, tc);
222 if (ret < 0)
223 return ret;
224
225 s = hh*3600LL + mm*60LL + ss;
226 if (s != (int32_t)s)
227 return AVERROR(EINVAL);
228
229 s = s * tc->fps + ff;
230 if (s != (int32_t)s)
231 return AVERROR(EINVAL);
232 tc->start = s;
233
234 if (tc->flags & AV_TIMECODE_FLAG_DROPFRAME) { /* adjust frame number */
235 int tmins = 60*hh + mm;
236 tc->start -= (tc->fps / 30 * 2) * (tmins - tmins/10);
237 }
238 return 0;
239}
240
241int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx)
242{

Callers 6

get_bmd_timecodeFunction · 0.85
mcc_initFunction · 0.85
time_tracker_initFunction · 0.85
time_tracker_set_timeFunction · 0.85
fill_timecodeFunction · 0.85

Calls 2

fps_from_frame_rateFunction · 0.85
check_timecodeFunction · 0.85

Tested by

no test coverage detected