diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-05-28 08:52:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-28 08:52:03 +0200 |
commit | 2ad28840b3fb90d9f000b676853846792e05bd68 (patch) | |
tree | f5d699cf49be342fdb1f5f07dba5750a9a6e7f87 /ffmpeg.c | |
parent | 91db8ff203048e3d6fed589e8352d3a5407d4302 (diff) | |
parent | 538bf767373f176b6487e30181155e74b37cced6 (diff) | |
download | ffmpeg-2ad28840b3fb90d9f000b676853846792e05bd68.tar.gz |
Merge commit '538bf767373f176b6487e30181155e74b37cced6'
* commit '538bf767373f176b6487e30181155e74b37cced6':
avconv: make -aspect work with streamcopy
Conflicts:
ffmpeg.c
ffmpeg_opt.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -2117,6 +2117,7 @@ static int transcode_init(void) } if (ost->stream_copy) { + AVRational sar; uint64_t extra_size; av_assert0(ist && !ost->filter); @@ -2225,19 +2226,17 @@ static int transcode_init(void) codec->height = icodec->height; codec->has_b_frames = icodec->has_b_frames; if (ost->frame_aspect_ratio.num) { // overridden by the -aspect cli option - codec->sample_aspect_ratio = - ost->st->sample_aspect_ratio = + sar = av_mul_q(ost->frame_aspect_ratio, (AVRational){ codec->height, codec->width }); av_log(NULL, AV_LOG_WARNING, "Overriding aspect ratio " "with stream copy may produce invalid files\n"); - } else if (!codec->sample_aspect_ratio.num) { - codec->sample_aspect_ratio = - ost->st->sample_aspect_ratio = - ist->st->sample_aspect_ratio.num ? ist->st->sample_aspect_ratio : - ist->st->codec->sample_aspect_ratio.num ? - ist->st->codec->sample_aspect_ratio : (AVRational){0, 1}; } + else if (ist->st->sample_aspect_ratio.num) + sar = ist->st->sample_aspect_ratio; + else + sar = icodec->sample_aspect_ratio; + ost->st->sample_aspect_ratio = codec->sample_aspect_ratio = sar; ost->st->avg_frame_rate = ist->st->avg_frame_rate; break; case AVMEDIA_TYPE_SUBTITLE: |