[FFmpeg-devel] [PATCH 6/6] MOV: iTunes media type

Baptiste Coudurier baptiste.coudurier
Mon Nov 23 06:08:31 CET 2009


On 11/22/09 8:14 PM, David Conrad wrote:
> [...]
>
> +    { 5, "Whacked Bookmark" },

What's that ? :)

 > [...]
 >
> +
> +int ff_mov_stik_name_to_num(char *name)
> +{
> +    int i;
> +    for (i = 0; i<  FF_ARRAY_ELEMS(mov_stik_names); i++)
> +        if (!strcasecmp(name, mov_stik_names[i].name))
> +            return mov_stik_names[i].stik;
> +    return -1;
> +}
> +
 >
> +const char* ff_mov_stik_num_to_name(int code)
> +{
> +    int i;
> +    for (i = 0; i<  FF_ARRAY_ELEMS(mov_stik_names); i++)
> +        if (mov_stik_names[i].stik == code)
> +            return mov_stik_names[i].name;
> +    return NULL;
> +}

Are they used only in the demuxer and only if the muxer respectively ?
If so, put them static in these files.

 > [...]
 >
>   }
>
> +static int mov_write_stik_tag(ByteIOContext *pb, MOVMuxContext *mov,
> +                              AVFormatContext *s)
> +{
> +    AVMetadataTag *t = av_metadata_get(s->metadata, "itunes_type", NULL, 0);
> +    int size = 0, stik = t ? ff_mov_stik_name_to_num(t->value) : -1;
> +    if (stik>= 0) {
> +        int64_t pos = url_ftell(pb);
> +        put_be32(pb, 0); /* size */
> +        put_tag(pb, "stik");
> +        {
> +            int64_t pos = url_ftell(pb);
> +            put_be32(pb, 0); /* size */
> +            put_tag(pb, "data");
> +            put_be32(pb, 0);        // 8 bytes empty
> +            put_be32(pb, 0);
> +            put_byte(pb, stik);
> +            updateSize(pb, pos);
> +        }
> +        size = updateSize(pb, pos);
> +    }
> +    return size;
> +}

Same comment as before.

[...]

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list