Commit 2ad28840 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '538bf767'

* commit '538bf767':
  avconv: make -aspect work with streamcopy

Conflicts:
	ffmpeg.c
	ffmpeg_opt.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 91db8ff2 538bf767
...@@ -2117,6 +2117,7 @@ static int transcode_init(void) ...@@ -2117,6 +2117,7 @@ static int transcode_init(void)
} }
if (ost->stream_copy) { if (ost->stream_copy) {
AVRational sar;
uint64_t extra_size; uint64_t extra_size;
av_assert0(ist && !ost->filter); av_assert0(ist && !ost->filter);
...@@ -2225,19 +2226,17 @@ static int transcode_init(void) ...@@ -2225,19 +2226,17 @@ static int transcode_init(void)
codec->height = icodec->height; codec->height = icodec->height;
codec->has_b_frames = icodec->has_b_frames; codec->has_b_frames = icodec->has_b_frames;
if (ost->frame_aspect_ratio.num) { // overridden by the -aspect cli option if (ost->frame_aspect_ratio.num) { // overridden by the -aspect cli option
codec->sample_aspect_ratio = sar =
ost->st->sample_aspect_ratio =
av_mul_q(ost->frame_aspect_ratio, av_mul_q(ost->frame_aspect_ratio,
(AVRational){ codec->height, codec->width }); (AVRational){ codec->height, codec->width });
av_log(NULL, AV_LOG_WARNING, "Overriding aspect ratio " av_log(NULL, AV_LOG_WARNING, "Overriding aspect ratio "
"with stream copy may produce invalid files\n"); "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; ost->st->avg_frame_rate = ist->st->avg_frame_rate;
break; break;
case AVMEDIA_TYPE_SUBTITLE: case AVMEDIA_TYPE_SUBTITLE:
......
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