[FFmpeg-devel] LPCM for mpeg-ts, the second
Diego Biurrun
diego
Sun Aug 2 13:02:56 CEST 2009
On Sun, Aug 02, 2009 at 01:17:11PM +0300, Christian P. Schmidt wrote:
> Diego Biurrun wrote:
> > On Sun, Aug 02, 2009 at 10:54:57AM +0300, Christian P. Schmidt wrote:
> >> Attached a second attempt at adding the support for LPCM streams in mpeg transport streams.
> >
> >> +#if CONFIG_DECODERS
> >> +#define PCM_MPEG_DECODER(id,name,long_name_) \
> >> +AVCodec name ## _decoder = { \
> >> + #name, \
> >> + CODEC_TYPE_AUDIO, \
> >> + id, \
> >> + sizeof(PCMDecode), \
> >> + pcm_mpeg_decode_init, \
> >> + NULL, \
> >> + NULL, \
> >> + pcm_mpeg_decode_frame, \
> >> + .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S32, SAMPLE_FMT_NONE}, \
> >> + .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
> >> +};
> >> +#else
> >> +#define PCM_MPEG_DECODER(id,name,long_name_)
> >> +#endif
> >> +
> >> +#define PCM_CODEC(id, sample_fmt_, name, long_name_) \
> >> + PCM_ENCODER(id,sample_fmt_,name,long_name_) PCM_DECODER(id,sample_fmt_,name,long_name_)
> >> +
> >> +/* Note: Do not forget to add new entries to the Makefile as well. */
> >> +PCM_MPEG_DECODER(CODEC_ID_PCM_BLURAY, pcm_bluray, "PCM signed 16|20|24-bit big-endian");
> >
> > I don't think it makes sense to use a macro for one declaration.
>
> Agreed. The macro is there to easily move pcm_dvd here in the next phase.
> The PCM_CODEC macro is a copy&paste leftover and will be removed - I can't
> encode without complete knowledge of the meaning of the remaining bits.
I don't think you save much even for two declarations.
Another issue is that CONFIG_DECODERS is the wrong condition, it should
be CONFIG_DVD_PCM_DECODER. Either fix your macro or use a direct
declaration.
Diego
P.S.: Please teach your Thunderbird to break lines after a reasonable
length, e.g. 72 characters.
More information about the ffmpeg-devel
mailing list