diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2003-09-16 20:26:35 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2003-09-16 20:26:35 +0000 |
commit | 211f2123c53a140009ce6c1abe4a513aaf8f4645 (patch) | |
tree | cad615c7a5676775c7c1ed69bec89bf307944423 | |
parent | 61890b02b3c8e6b6e31133dc1b2bf723c60f5378 (diff) | |
download | ffmpeg-211f2123c53a140009ce6c1abe4a513aaf8f4645.tar.gz |
avoid initializing pts for not decoded streams
Originally committed as revision 2284 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | ffmpeg.c | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -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) */ |