| 2886 | } |
| 2887 | |
| 2888 | static 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 | |
| 2912 | static enum AVChromaLocation choose_chroma_location(AVFormatContext *s, AVStream *st) |
| 2913 | { |
no test coverage detected