[FFmpeg-devel] [PATCH 1/2] avformat: read id3v2 comment tags

Josh de Kock josh at itanimul.li
Sat Jul 23 05:41:23 EEST 2016


On Sat, Jul 23, 2016, at 01:59 AM, kode54 at gmail.com wrote:
> [...]
>  
>  /**
> + * Parse a comment tag.
> + */
> +static void read_comm(AVFormatContext *s, AVIOContext *pb, int taglen,
> +                      AVDictionary **metadata)
This should probably be `read_comment`, it's not too long of a
function name, and `read_comm` sounds a little ambiguous.

> +{
> +    const char *key = "comment";
> +    uint8_t *dst;
> +    int encoding, dict_flags = AV_DICT_DONT_OVERWRITE |
> AV_DICT_DONT_STRDUP_VAL;
> +    int language;
> +
> +    if (taglen < 4)
> +        return;
> +
> +    encoding = avio_r8(pb);
> +    taglen--;
> +
> +    language = avio_rl24(pb);
> +    taglen -= 3;
Unless you intend to do checking of `encoding`/`language`, and 
proceed conditionally, this should probably combine both `taglen` 
statements. E.g.

encoding = avio_r8(pb);
language = avio_rl24(pb);
tagline -= 4;

> [...]

As far I can tell, that's it for this patch (someone else might
have some more comments).

--
Josh



More information about the ffmpeg-devel mailing list