[FFmpeg-devel] [PATCH 2/2] avformat/westwoodaudenc Adds muxer for Westwood AUD format.

Zane van Iperen zane at zanevaniperen.com
Fri Apr 23 16:52:42 EEST 2021



On 23/4/21 6:51 pm, Aidan Richmond wrote:

> +    /* This flags that the file contains 16 bit samples rather than 8 bit
> +       since the encoder only encodes 16 bit samples this should be set. */
> +    flags |= 2;
> +
> +    avio_wl16(pb, s->codecpar->sample_rate);
> +    /* We don't know the file size yet, so just skip forward 8 bytes */
> +    avio_seek(pb, 8, SEEK_CUR);

Might be better to ffio_fill() with zeros here instead.

> +    avio_w8(pb, flags);
> +    /* 99 indicates the ADPCM format. Other formats not supported. */
> +    avio_w8(pb, 99);
> +
> +    return 0;
> +}

> +AVOutputFormat ff_wsaud_muxer = {
> +    .name              = "wsaud",
> +    .long_name         = NULL_IF_CONFIG_SMALL("Westwood Studios audio"),
> +    .extensions        = "aud",
> +    .priv_data_size    = sizeof(AUDMuxContext),
> +    .audio_codec       = AV_CODEC_ID_ADPCM_IMA_WS,
> +    .video_codec       = AV_CODEC_ID_NONE,
> +    .flags             = AVFMT_TS_NONSTRICT,

Why nonstrict? Does this format explicitly support it?

> +    .write_header      = wsaud_write_header,
> +    .write_packet      = wsaud_write_packet,
> +    .write_trailer     = wsaud_write_trailer,
> +};
> 

Zane


More information about the ffmpeg-devel mailing list