| 239 | } |
| 240 | |
| 241 | int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx) |
| 242 | { |
| 243 | char c; |
| 244 | int hh, mm, ss, ff, flags; |
| 245 | |
| 246 | if (sscanf(str, "%d:%d:%d%c%d", &hh, &mm, &ss, &c, &ff) != 5) { |
| 247 | av_log(log_ctx, AV_LOG_ERROR, "Unable to parse timecode, " |
| 248 | "syntax: hh:mm:ss[:;.]ff\n"); |
| 249 | return AVERROR_INVALIDDATA; |
| 250 | } |
| 251 | flags = c != ':' ? AV_TIMECODE_FLAG_DROPFRAME : 0; // drop if ';', '.', ... |
| 252 | |
| 253 | return av_timecode_init_from_components(tc, rate, flags, hh, mm, ss, ff, log_ctx); |
| 254 | } |
no test coverage detected