[FFmpeg-devel] [PATCH] LPCM in MPEG-TS, next iteration

Reimar Döffinger Reimar.Doeffinger
Sat Aug 15 01:22:05 CEST 2009


On Sat, Aug 15, 2009 at 02:14:05AM +0300, Christian P. Schmidt wrote:
> Reimar D?ffinger wrote:
> > On Fri, Aug 14, 2009 at 06:54:39PM +0300, Christian P. Schmidt wrote:
> >> +static av_cold int pcm_bluray_decode_init(AVCodecContext *avctx)
> >> +{
> >> +    avctx->sample_fmt = SAMPLE_FMT_NONE; ///< Will be determined from the header
> >> +    return 0;
> >> +}
> > 
> > Is this necessary?
> 
> I removed the sample_fmt initialization. The function seems necessary as
>  ffplay crashed on me without, and with NULL in it's place down in the
> codec struct.

That sounds wrong, please send some debugging info.

> >> +    const uint8_t bits_per_samples[4] = { 0, 16, 20, 24 };
> >> +    const int64_t channel_layouts[16] = {
> >> +    const uint8_t channels[16] = {
> >> +    const int sample_rates[16] = {
> > I think these also should be static.
> > Also why is channel_layouts 64 bits and signed?
> > A switch-case would make slightly more sense for sample_rates, too.
> 
> There no need for static as they are inside the function, and noone else
> needs them.

Hm? The point of static is to make sure the compiler doesn't do something
silly like constructing the table at runtime on the stack...



More information about the ffmpeg-devel mailing list