Imported Upstream version 6.1
[platform/upstream/ffmpeg.git] / libavformat / options.c
index 0079a06..1d8c522 100644 (file)
@@ -44,7 +44,7 @@ static const char* format_to_name(void* ptr)
     AVFormatContext* fc = (AVFormatContext*) ptr;
     if(fc->iformat) return fc->iformat->name;
     else if(fc->oformat) return fc->oformat->name;
-    else return "NULL";
+    else return fc->av_class->class_name;
 }
 
 static void *format_child_next(void *obj, void *prev)
@@ -151,10 +151,12 @@ static int io_open_default(AVFormatContext *s, AVIOContext **pb,
     return ffio_open_whitelist(pb, url, flags, &s->interrupt_callback, options, s->protocol_whitelist, s->protocol_blacklist);
 }
 
+#if FF_API_AVFORMAT_IO_CLOSE
 void ff_format_io_close_default(AVFormatContext *s, AVIOContext *pb)
 {
     avio_close(pb);
 }
+#endif
 
 static int io_close2_default(AVFormatContext *s, AVIOContext *pb)
 {
@@ -172,7 +174,11 @@ AVFormatContext *avformat_alloc_context(void)
     s = &si->pub;
     s->av_class = &av_format_context_class;
     s->io_open  = io_open_default;
+#if FF_API_AVFORMAT_IO_CLOSE
+FF_DISABLE_DEPRECATION_WARNINGS
     s->io_close = ff_format_io_close_default;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     s->io_close2= io_close2_default;
 
     av_opt_set_defaults(s);
@@ -184,7 +190,9 @@ AVFormatContext *avformat_alloc_context(void)
         return NULL;
     }
 
+#if FF_API_LAVF_SHORTEST
     si->shortest_end = AV_NOPTS_VALUE;
+#endif
 
     return s;
 }
@@ -214,6 +222,7 @@ static const AVOption stream_options[] = {
         { "clean_effects",      .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CLEAN_EFFECTS     },    .unit = "disposition" },
         { "attached_pic",       .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_ATTACHED_PIC      },    .unit = "disposition" },
         { "timed_thumbnails",   .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_TIMED_THUMBNAILS  },    .unit = "disposition" },
+        { "non_diegetic",       .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_NON_DIEGETIC      },    .unit = "disposition" },
         { "captions",           .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CAPTIONS          },    .unit = "disposition" },
         { "descriptions",       .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DESCRIPTIONS      },    .unit = "disposition" },
         { "metadata",           .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_METADATA          },    .unit = "disposition" },
@@ -257,10 +266,7 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
         return NULL;
     st = &sti->pub;
 
-#if FF_API_AVSTREAM_CLASS
     st->av_class = &stream_class;
-#endif
-
     st->codecpar = avcodec_parameters_alloc();
     if (!st->codecpar)
         goto fail;
@@ -306,7 +312,9 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
 
     st->sample_aspect_ratio = (AVRational) { 0, 1 };
 
+#if FF_API_AVSTREAM_SIDE_DATA
     sti->inject_global_side_data = si->inject_global_side_data;
+#endif
 
     sti->need_context_update = 1;