if ((ret = av_opt_set_dict(s, &tmp)) < 0)
goto fail;
- #if FF_API_LAVF_BITEXACT
- av_log(s, AV_LOG_WARNING,
- "Setting the AVFormatContext to bitexact mode, because "
- "the AVCodecContext is in that mode. This behavior will "
- "change in the future. To keep the current behavior, set "
- "AVFormatContext.flags |= AVFMT_FLAG_BITEXACT.\n");
- s->flags |= AVFMT_FLAG_BITEXACT;
- #else
+ if (s->priv_data && s->oformat->priv_class && *(const AVClass**)s->priv_data==s->oformat->priv_class &&
+ (ret = av_opt_set_dict2(s->priv_data, &tmp, AV_OPT_SEARCH_CHILDREN)) < 0)
+ goto fail;
+
+#if FF_API_LAVF_AVCTX
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (s->nb_streams && s->streams[0]->codec->flags & AV_CODEC_FLAG_BITEXACT) {
+ if (!(s->flags & AVFMT_FLAG_BITEXACT)) {
- #endif
+ av_log(s, AV_LOG_WARNING,
+ "The AVFormatContext is not in set to bitexact mode, only "
+ "the AVCodecContext. If this is not intended, set "
+ "AVFormatContext.flags |= AVFMT_FLAG_BITEXACT.\n");
+ }
+ }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
// some sanity checks
if (s->nb_streams == 0 && !(of->flags & AVFMT_NOSTREAMS)) {
* FF_API_* defines may be placed below to indicate public API that will be
* dropped at a future version bump. The defines themselves are not part of
* the public API and may change, break or disappear at any time.
+ *
+ * @note, when bumping the major version it is recommended to manually
+ * disable each FF_API_* in its own commit instead of disabling them all
+ * at once through the bump. This improves the git bisect-ability of the change.
+ *
*/
- #ifndef FF_API_LAVF_BITEXACT
- #define FF_API_LAVF_BITEXACT (LIBAVFORMAT_VERSION_MAJOR < 58)
- #endif
#ifndef FF_API_LAVF_FRAC
#define FF_API_LAVF_FRAC (LIBAVFORMAT_VERSION_MAJOR < 58)
#endif