[FFmpeg-devel] MPEG TS encoding problem on change from stereo to mono, pay for fix
Reimar Döffinger
Reimar.Doeffinger
Wed Dec 1 09:14:03 CET 2010
On Wed, Dec 01, 2010 at 04:10:49AM +0100, Michael Niedermayer wrote:
> On Wed, Nov 24, 2010 at 12:10:47AM +0100, Stefano Sabatini wrote:
> > @@ -776,7 +779,7 @@ static void do_audio_out(AVFormatContext *s,
> > int64_t audio_out_size, audio_buf_size;
> > int64_t allocated_for_size= size;
> >
> > - int size_out, frame_bytes, ret;
> > + int size_out, frame_bytes, ret, resample_changed;
> > AVCodecContext *enc= ost->st->codec;
> > AVCodecContext *dec= ist->st->codec;
> > int osize= av_get_bits_per_sample_fmt(enc->sample_fmt)/8;
> > @@ -810,7 +813,28 @@ need_realloc:
>
>
> > if (enc->channels != dec->channels)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > ost->audio_resample = 1;
> >
> > - if (ost->audio_resample && !ost->resample) {
> > + resample_changed = ost->resample_sample_fmt != dec->sample_fmt ||
> > + ost->resample_channels != dec->channels ||
>
> this looks redundant
Huh? One checks whether decoder output and encoder input differ,
the other one checks whether the decoder output format changed...
More information about the ffmpeg-devel
mailing list