[FFmpeg-devel] MPEG TS encoding problem on change from stereo to mono, pay for fix
Michael Niedermayer
michaelni
Wed Dec 1 17:00:19 CET 2010
On Wed, Dec 01, 2010 at 09:14:03AM +0100, Reimar D?ffinger wrote:
> 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...
they can differ and still not change?
btw, it might make more sense to have some function like sws_getCachedContext()
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The real ebay dictionary, page 1
"Used only once" - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101201/c89d9a1a/attachment.pgp>
More information about the ffmpeg-devel
mailing list