]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mov.c
avformat: add windows.h to SChannel SSP TLS code
[ffmpeg] / libavformat / mov.c
index f6462f7a2b60d05e14cf2c7664173a2f5fe1adf2..e2f107ff0754d5c904aaf0f4e1f8945401bc453e 100644 (file)
@@ -1812,16 +1812,9 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
                                  AVStream *st, MOVStreamContext *sc)
 {
     int bits_per_sample, flags;
-    uint32_t format;
-    uint16_t version;
+    uint16_t version = avio_rb16(pb);
     AVDictionaryEntry *compatible_brands = av_dict_get(c->fc->metadata, "compatible_brands", NULL, AV_DICT_MATCH_CASE);
 
-    avio_seek(pb, -12, SEEK_CUR);
-    format = avio_rb32(pb);
-    avio_seek(pb, 8, SEEK_CUR);
-
-    version = avio_rb16(pb);
-
     avio_rb16(pb); /* revision level */
     avio_rb32(pb); /* vendor */
 
@@ -1870,7 +1863,7 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
         }
     }
 
-    if (format == 0) {
+    if (sc->format == 0) {
         if (st->codec->bits_per_coded_sample == 8)
             st->codec->codec_id = mov_codec_id(st, MKTAG('r','a','w',' '));
         else if (st->codec->bits_per_coded_sample == 16)
@@ -3058,13 +3051,23 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     if (sc->dref_id-1 < sc->drefs_count && sc->drefs[sc->dref_id-1].path) {
         MOVDref *dref = &sc->drefs[sc->dref_id - 1];
-        if (mov_open_dref(c, &sc->pb, c->fc->filename, dref,
-                          &c->fc->interrupt_callback) < 0)
-            av_log(c->fc, AV_LOG_ERROR,
-                   "stream %d, error opening alias: path='%s', dir='%s', "
-                   "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n",
+        if (c->enable_drefs) {
+            if (mov_open_dref(c, &sc->pb, c->fc->filename, dref,
+                              &c->fc->interrupt_callback) < 0)
+                av_log(c->fc, AV_LOG_ERROR,
+                       "stream %d, error opening alias: path='%s', dir='%s', "
+                       "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n",
+                       st->index, dref->path, dref->dir, dref->filename,
+                       dref->volume, dref->nlvl_from, dref->nlvl_to);
+        } else {
+            av_log(c->fc, AV_LOG_WARNING,
+                   "Skipped opening external track: "
+                   "stream %d, alias: path='%s', dir='%s', "
+                   "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d."
+                   "Set enable_drefs to allow this.\n",
                    st->index, dref->path, dref->dir, dref->filename,
                    dref->volume, dref->nlvl_from, dref->nlvl_to);
+        }
     } else {
         sc->pb = c->fc->pb;
         sc->pb_is_copied = 1;
@@ -5226,6 +5229,8 @@ static const AVOption mov_options[] = {
         AV_OPT_TYPE_BINARY, {.str="77214d4b196a87cd520045fd20a51d67"},
         .flags = AV_OPT_FLAG_DECODING_PARAM },
     { "decryption_key", "The media decryption key (hex)", OFFSET(decryption_key), AV_OPT_TYPE_BINARY, .flags = AV_OPT_FLAG_DECODING_PARAM },
+    { "enable_drefs", "Enable external track support.", OFFSET(enable_drefs), AV_OPT_TYPE_BOOL,
+        {.i64 = 0}, 0, 1, FLAGS },
 
     { NULL },
 };