summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-28 08:52:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-28 08:52:03 +0200
commit2ad28840b3fb90d9f000b676853846792e05bd68 (patch)
treef5d699cf49be342fdb1f5f07dba5750a9a6e7f87 /ffmpeg.c
parent91db8ff203048e3d6fed589e8352d3a5407d4302 (diff)
parent538bf767373f176b6487e30181155e74b37cced6 (diff)
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.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 785c334795..40b96085a1 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -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: