Commit 24c17e92 authored by michael's avatar michael

initial timestamp fix


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3485 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent dbef1386
...@@ -1717,7 +1717,9 @@ static int av_encode(AVFormatContext **output_files, ...@@ -1717,7 +1717,9 @@ static int av_encode(AVFormatContext **output_files,
ist = ist_table[i]; ist = ist_table[i];
is = input_files[ist->file_index]; is = input_files[ist->file_index];
ist->pts = 0; ist->pts = 0;
ist->next_pts = 0; ist->next_pts = ist->st->start_time;
if(ist->next_pts == AV_NOPTS_VALUE)
ist->next_pts=0;
ist->is_start = 1; ist->is_start = 1;
} }
...@@ -2732,6 +2734,7 @@ static void opt_input_file(const char *filename) ...@@ -2732,6 +2734,7 @@ static void opt_input_file(const char *filename)
AVFormatContext *ic; AVFormatContext *ic;
AVFormatParameters params, *ap = &params; AVFormatParameters params, *ap = &params;
int err, i, ret, rfps, rfps_base; int err, i, ret, rfps, rfps_base;
int64_t timestamp;
if (!strcmp(filename, "-")) if (!strcmp(filename, "-"))
filename = "pipe:"; filename = "pipe:";
...@@ -2765,14 +2768,13 @@ static void opt_input_file(const char *filename) ...@@ -2765,14 +2768,13 @@ static void opt_input_file(const char *filename)
exit(1); exit(1);
} }
/* if seeking requested, we execute it */
if (start_time != 0) {
int64_t timestamp;
timestamp = start_time; timestamp = start_time;
/* add the stream start time */ /* add the stream start time */
if (ic->start_time != AV_NOPTS_VALUE) if (ic->start_time != AV_NOPTS_VALUE)
timestamp += ic->start_time; timestamp += ic->start_time;
/* if seeking requested, we execute it */
if (start_time != 0) {
ret = av_seek_frame(ic, -1, timestamp); ret = av_seek_frame(ic, -1, timestamp);
if (ret < 0) { if (ret < 0) {
fprintf(stderr, "%s: could not seek to position %0.3f\n", fprintf(stderr, "%s: could not seek to position %0.3f\n",
...@@ -2837,7 +2839,7 @@ static void opt_input_file(const char *filename) ...@@ -2837,7 +2839,7 @@ static void opt_input_file(const char *filename)
} }
input_files[nb_input_files] = ic; input_files[nb_input_files] = ic;
input_files_ts_offset[nb_input_files] = input_ts_offset; input_files_ts_offset[nb_input_files] = input_ts_offset - (copy_ts ? 0 : timestamp);
/* dump the file content */ /* dump the file content */
if (verbose >= 0) if (verbose >= 0)
dump_format(ic, nb_input_files, filename, 0); dump_format(ic, nb_input_files, filename, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment