On Tue, Aug 06, 2013 at 08:18:20PM +0200, Christian Schmidt wrote:
> --- a/libavcodec/pcm-mpeg.c
> +++ b/libavcodec/pcm-mpeg.c
> @@ -302,6 +311,243 @@ static int pcm_bluray_decode_frame(AVCodecContext 
> *avctx, void *data,
> +static av_cold int pcm_dvd_decode_init(AVCodecContext *avctx)
> +{
> +    PCMDVDContext *s = avctx->priv_data;
> +
> +    /* Invalid header to force parsing of the first header */
> +    s->last_header = -1;
> +    /* reserve space for 8 channels, 3 bytes/sample, 4 samples/block */
> +    if (!(s->extra_samples = av_malloc(8*3*4)))

spaces around * operator

> +static int pcm_dvd_parse_header(AVCodecContext *avctx,
> +                                const uint8_t *header)

no need to break the line

> +    /* 4 samples form a group in 20/24bit PCM on DVD Video.
> +     * A block is formed by the number of groups that are
> +     * needed to complete a set of samples for each channel. */
> +    if (avctx->bits_per_coded_sample == 16) {
> +        s->samples_per_block = 1;
> +        s->block_size = avctx->channels * 2;

align

> +static int pcm_dvd_decode_frame(AVCodecContext *avctx, void *data,
> +                                int *got_frame_ptr, AVPacket *avpkt)
> +{
> +    AVFrame *frame     = data;
> +    const uint8_t *src = avpkt->data;
> +    int buf_size       = avpkt->size;
> +    PCMDVDContext *s   = avctx->priv_data;
> +    int retval;
> +    int blocks;
> +    void * dst;

*dst

> +    if ((retval = pcm_dvd_parse_header(avctx, src)))
> +        return retval;
> +    src += 3;
> +    buf_size -= 3;

align

> @@ -313,3 +559,18 @@ AVCodec ff_pcm_bluray_decoder = {
> +
> +AVCodec ff_pcm_dvd_decoder = {
> +    .name           = "pcm_dvd",
> +    .long_name      = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit 
> big-endian for DVD media"),
> +    .type           = AVMEDIA_TYPE_AUDIO,
> +    .id             = AV_CODEC_ID_PCM_DVD,
> +    .priv_data_size = sizeof(PCMDVDContext),
> +    .init           = pcm_dvd_decode_init,
> +    .decode         = pcm_dvd_decode_frame,
> +    .close          = pcm_dvd_decode_uninit,
> +    .capabilities   = CODEC_CAP_DR1,
> +    .sample_fmts    = (const enum AVSampleFormat[]){

space between ) and {

The rest LGTM, thanks.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to