[FFmpeg-devel] [PATCH v2] avformat/westwood_aud: Adds PCM format demux.

Tomas Härdin tjoppen at acc.umu.se
Wed Mar 20 18:11:32 EET 2019


ons 2019-03-20 klockan 15:56 +0000 skrev Aidan R:
> tis 2019-03-19 klockan 22:53 +0000 skrev Aidan R:
> > > @@ -130,20 +161,24 @@ static int wsaud_read_packet(AVFormatContext *s,
> > >                               AVPacket *pkt)
> > >  {
> > >      AVIOContext *pb = s->pb;
> > > +    AUDDemuxContext *aud = s->priv_data;
> > >      unsigned char preamble[AUD_CHUNK_PREAMBLE_SIZE];
> > > -    unsigned int chunk_size;
> > > +    unsigned int chunk_size, bytes_per_sample;
> > >      int ret = 0;
> > >      AVStream *st = s->streams[0];
> > >  
> > > -    if (avio_read(pb, preamble, AUD_CHUNK_PREAMBLE_SIZE) !=
> > > -        AUD_CHUNK_PREAMBLE_SIZE)
> > > -        return AVERROR(EIO);
> > > +    /* AUD files don't store PCM audio in chunks */
> > > +    if (st->codecpar->codec_id != AV_CODEC_ID_PCM_S16LE) {
> > 
> > What about AV_CODEC_ID_PCM_U8?
> 
> Good catch, I don't think any actually exist in the wild, but I have supported
> the possibility in wsaud_read_header and from looking at the audio engine it
> looks to support it in theory.

Given the recent 24-bit ZMBV discussion on this list, I think we should
not implement support for things which we don't have samples for. Using
it in the probe function is probably fine, but we should error out in
wsaud_read_header() until we have an 8-bit sample. The U8
implementation in this patch can be dummied out with #ifdefs until
then, for convenient un-#ifdefing

> > 
> > A sample + FATE test for this would be nice
> 
> Some guidance on where to start for that would be most welcome. I have short
> examples from Blade Runner that could be used but wouldn't distributing them
> violate copyright?

Cutting them down to a second or two should be fine I think. If we want
to be paranoid we could zero out the sample data as well, but I doubt
anyone cares. There's plenty of such samples in FATE. We could do this
in a separate thread, it doesn't have to hold up this patch

/Tomas


More information about the ffmpeg-devel mailing list