lavf: deprecate AVFormatContext.timestamp

It's replaced by 'creation_time' metadata tag.
This commit is contained in:
Anton Khirnov
2011-07-07 11:25:03 +02:00
parent b12c259252
commit 5f847bf61d
7 changed files with 71 additions and 14 deletions

View File

@@ -183,7 +183,6 @@ static float mux_max_delay= 0.7;
static int64_t recording_time = INT64_MAX;
static int64_t start_time = 0;
static int64_t recording_timestamp = 0;
static int64_t input_ts_offset = 0;
static int file_overwrite = 0;
static AVDictionary *metadata;
@@ -712,9 +711,6 @@ static int read_ffserver_streams(AVFormatContext *s, const char *filename)
nopts = 1;
}
if (!nopts)
s->timestamp = av_gettime();
av_close_input_file(ic);
return 0;
}
@@ -3109,7 +3105,14 @@ static int opt_start_time(const char *opt, const char *arg)
static int opt_recording_timestamp(const char *opt, const char *arg)
{
recording_timestamp = parse_time_or_die(opt, arg, 0) / 1000000;
char buf[128];
int64_t recording_timestamp = parse_time_or_die(opt, arg, 0) / 1E6;
struct tm time = *gmtime((time_t*)&recording_timestamp);
strftime(buf, sizeof(buf), "creation_time=%FT%T%z", &time);
opt_metadata("metadata", buf);
av_log(NULL, AV_LOG_WARNING, "%s is deprecated, set the 'creation_time' metadata "
"tag instead.\n", opt);
return 0;
}
@@ -3823,8 +3826,6 @@ static void opt_output_file(const char *filename)
if (use_subtitle) new_subtitle_stream(oc, nb_output_files);
if (use_data) new_data_stream(oc, nb_output_files);
oc->timestamp = recording_timestamp;
av_dict_copy(&oc->metadata, metadata, 0);
av_dict_free(&metadata);
}