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

Function mxf_init_timecode

libavformat/mxfenc.c:2888–2910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2886}
2887
2888static int mxf_init_timecode(AVFormatContext *s, AVStream *st, AVRational tbc)
2889{
2890 MXFContext *mxf = s->priv_data;
2891 AVDictionaryEntry *tcr = av_dict_get(s->metadata, "timecode", NULL, 0);
2892
2893 if (!ff_mxf_get_content_package_rate(tbc)) {
2894 if (s->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) {
2895 av_log(s, AV_LOG_ERROR, "Unsupported frame rate %d/%d. Set -strict option to 'unofficial' or lower in order to allow it!\n", tbc.den, tbc.num);
2896 return AVERROR(EINVAL);
2897 } else {
2898 av_log(s, AV_LOG_WARNING, "Unofficial frame rate %d/%d.\n", tbc.den, tbc.num);
2899 }
2900 }
2901
2902 mxf->timecode_base = (tbc.den + tbc.num/2) / tbc.num;
2903 if (!tcr)
2904 tcr = av_dict_get(st->metadata, "timecode", NULL, 0);
2905
2906 if (tcr)
2907 return av_timecode_init_from_string(&mxf->tc, av_inv_q(tbc), tcr->value, s);
2908 else
2909 return av_timecode_init(&mxf->tc, av_inv_q(tbc), 0, 0, s);
2910}
2911
2912static enum AVChromaLocation choose_chroma_location(AVFormatContext *s, AVStream *st)
2913{

Callers 1

mxf_initFunction · 0.85

Calls 5

av_dict_getFunction · 0.85
av_logFunction · 0.85
av_timecode_initFunction · 0.85

Tested by

no test coverage detected