]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/movenc.c
avcodec/mpeg12: Fix error return
[ffmpeg] / libavformat / movenc.c
index 1aff5c52f4b3a3f15765eb6bf1cb22a3a4261c4e..b9c0f7ae67ed6b85bc104d895503af937cdc1e5e 100644 (file)
@@ -5370,13 +5370,7 @@ static int mov_write_header(AVFormatContext *s)
         mov_write_mdat_tag(pb, mov);
     }
 
-    if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) {
-        mov->time = ff_iso8601_to_unix_time(t->value);
-        if (mov->time < 0) {
-            av_log(s, AV_LOG_WARNING, "Failed to parse creation_time %s\n", t->value);
-            mov->time = 0;
-        }
-    }
+    ff_parse_creation_time_metadata(s, &mov->time, 1);
     if (mov->time)
         mov->time += 0x7C25B080; // 1970 based -> 1904 based
 
@@ -5534,7 +5528,7 @@ static int shift_data(AVFormatContext *s)
      * writing, so we re-open the same output, but for reading. It also avoids
      * a read/seek/write/seek back and forth. */
     avio_flush(s->pb);
-    ret = avio_open(&read_pb, s->filename, AVIO_FLAG_READ);
+    ret = s->io_open(s, &read_pb, s->filename, AVIO_FLAG_READ, NULL);
     if (ret < 0) {
         av_log(s, AV_LOG_ERROR, "Unable to re-open %s output file for "
                "the second pass (faststart)\n", s->filename);
@@ -5566,7 +5560,7 @@ static int shift_data(AVFormatContext *s)
         avio_write(s->pb, read_buf[read_buf_id], n);
         pos += n;
     } while (pos < pos_end);
-    avio_close(read_pb);
+    ff_format_io_close(s, &read_pb);
 
 end:
     av_free(buf);