[FFmpeg-devel] MPEG TS encoding problem on change from stereo to mono, pay for fix

Stefano Sabatini stefano.sabatini-lala
Mon Nov 22 10:27:37 CET 2010


On date Monday 2010-11-22 00:12:36 +0100, Reimar D?ffinger encoded:
> On Sun, Nov 21, 2010 at 11:11:30PM +0100, Stefano Sabatini wrote:
> > On date Friday 2010-11-19 23:05:34 +0100, Reimar D?ffinger encoded:
> > > On Fri, Nov 19, 2010 at 03:26:57PM +0100, Stefano Sabatini wrote:
> > > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > > > index bff9477..22e3615 100644
> > > > --- a/libavcodec/avcodec.h
> > > > +++ b/libavcodec/avcodec.h
> > > > @@ -3076,6 +3076,14 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
> > > >                                          int filter_length, int log2_phase_count,
> > > >                                          int linear, double cutoff);
> > > >  
> > > > +int av_audio_resample_reinit(ReSampleContext **ctx,
> > > > +                             int output_channels, int input_channels,
> > > > +                             int output_rate, int input_rate,
> > > > +                             enum AVSampleFormat sample_fmt_out,
> > > > +                             enum AVSampleFormat sample_fmt_in,
> > > > +                             int filter_length, int log2_phase_count,
> > > > +                             int linear, double cutoff);
> > > 
> > > I'm not convinced this should be public API, since it only
> > > checks for changes to the first arguments but not filter_length
> > > etc. I'd consider it too confusing/hackish to make it public...
> > 
> > The problem is that those values cannot be checked in the
> > ReSampleContext, as are defined in AVResampleContext, which is opaque
> > in resample.c where the function is defined.
> > 
> > If we want to quickly fix the problem we could simply state in the
> > docs that those values are supposed to be the same, or make
> > AVResampleContext definition visible in resample.c, which doesn't look
> > a good idea.
> 
> Or we could (for now) leave it completely up to the application to
> keep track of which values they created the context with.
> Would also be simpler in this case, since within FFmpeg we don't
> have to check if any of the output stuff changed since that is
> always the same.

Makes sense, patch updated.
-- 
FFmpeg = Fancy and Fabulous Mystic Puritan Exxagerate Game



More information about the ffmpeg-devel mailing list