[FFmpeg-devel] [PATCH 1/3] spdifenc: add support for E-AC3

Anssi Hannula anssi.hannula
Wed Nov 17 17:46:51 CET 2010


On 16.11.2010 03:44, Anssi Hannula wrote:
[...]
> @@ -210,12 +253,16 @@ static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt)
>      IEC958Context *ctx = s->priv_data;
>      int ret, padding;
>  
> -    ctx->pkt_size = FFALIGN(pkt->size, 2) << 3;
> +    ctx->out_bytes = pkt->size;
> +    ctx->length_code = FFALIGN(pkt->size, 2) << 3;

Oops, an embarrassing mistake here. out_buf should be initialized here,
otherwise the below call segfaults if it is not set by the
codec-specific function.

Patch attached, please apply.

[...]
> +    ff_spdif_bswap_buf16((uint16_t *)ctx->buffer, (uint16_t *)ctx->out_buf, ctx->out_bytes >> 1);
> +    put_buffer(s->pb, ctx->buffer, ctx->out_bytes & ~1);

-- 
Anssi Hannula



More information about the ffmpeg-devel mailing list