Commit 0d354897 authored by bellard's avatar bellard

avoid initializing pts for not decoded streams


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2284 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 392cd1f8
......@@ -1121,18 +1121,20 @@ static int av_encode(AVFormatContext **output_files,
ist = ist_table[i];
is = input_files[ist->file_index];
ist->pts = 0;
switch (ist->st->codec.codec_type) {
case CODEC_TYPE_AUDIO:
av_frac_init(&ist->next_pts,
0, 0, is->pts_num * ist->st->codec.sample_rate);
break;
case CODEC_TYPE_VIDEO:
av_frac_init(&ist->next_pts,
0, 0, is->pts_num * ist->st->codec.frame_rate);
break;
default:
break;
}
if (ist->decoding_needed) {
switch (ist->st->codec.codec_type) {
case CODEC_TYPE_AUDIO:
av_frac_init(&ist->next_pts,
0, 0, is->pts_num * ist->st->codec.sample_rate);
break;
case CODEC_TYPE_VIDEO:
av_frac_init(&ist->next_pts,
0, 0, is->pts_num * ist->st->codec.frame_rate);
break;
default:
break;
}
}
}
/* compute buffer size max (should use a complete heuristic) */
......
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