[FFmpeg-devel] [PATCH 2/3] RSD demuxer

Clément Bœsch ubitux at gmail.com
Mon Apr 22 11:35:25 CEST 2013


On Mon, Apr 22, 2013 at 06:26:41AM -0300, James Almer wrote:
[...]
> +#include "libavcodec/bytestream.h"
> +#include "libavutil/intreadwrite.h"
> +#include "avformat.h"
> +#include "avio.h"
> +#include "internal.h"
> +
> +typedef struct RSDDemuxContext {
> +    uint8_t     *table;
> +} RSDDemuxContext;
> +
> +static const AVCodecTag ff_codec_rsd_tags[] = {    

trailing whitespaces

Also, we don't use ff_ for local data.

> +    { AV_CODEC_ID_ADPCM_THP,       MKTAG('G','A','D','P') },
> +    { AV_CODEC_ID_PCM_S16BE,       MKTAG('P','C','M','B') },
> +    { AV_CODEC_ID_PCM_S16LE,       MKTAG('P','C','M',' ') },
> +    { AV_CODEC_ID_NONE, 0 },
> +};
> +
> +static const uint32_t ff_codec_rsd_unsupported_tags[] = {

ditto

> +    MKTAG('O','G','G',' '), // RSD6OGG, vorbis
> +    MKTAG('R','A','D','P'), // RSD4RADP and RSD6RADP, adpcm_ima_wav
> +    MKTAG('V','A','G',' '), // RSD2, 3, 4 and 6 VAG, adpcm_xa
> +    MKTAG('W','A','D','P'), // RSD6WADP, adpcm_thp
> +    MKTAG('X','A','D','P'), // RSD2XADP and RSD6XADP, adpcm_ima_wav
> +    MKTAG('X','M','A',' '), // RSD6XMA, WMAV2? XMA?

> +    0

You don't need this; FF_ARRAY_ELEMS() is your friend.

> +};
> +
> +static int rsd_probe(AVProbeData *p)
> +{
> +    int version = atoi(&p->buf[3]);

Are you sure there is no way to have following trailing ascii character
after the version? According to the following code, it is stored on 8-bit,
so you can just p->buf[3]-'0'

[...]
> +
> +        if ((ret = av_new_packet(pkt, size)) < 0)            

trailing whitespaces

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130422/bc3e43b7/attachment.asc>


More information about the ffmpeg-devel mailing list