[FFmpeg-devel] [PATCH] matroskaenc: write tags.
David Conrad
lessen42
Thu Mar 25 09:25:34 CET 2010
On Mar 20, 2010, at 4:51 AM, Anton Khirnov wrote:
> added a metadata conv table to the muxer + it now adds per-track/chapter
> tags to the cluster seekhead, not main.
>
> Anton Khirnov
Why can't all tags be stored in one level-one element? At least, I don't see from the spec why this wouldn't work.
> + simpletag = start_ebml_master(s->pb, MATROSKA_ID_SIMPLETAG, 0);
> + put_ebml_string(s->pb, MATROSKA_ID_TAGNAME, t->key);
> + put_ebml_string(s->pb, MATROSKA_ID_TAGLANG, "und");
> + put_ebml_uint( s->pb, MATROSKA_ID_TAGDEFAULT, 1);
No need to write mandatory elements if we never use anything but the default value.
> + if (av_metadata_get(s->metadata, "", NULL, AV_METADATA_IGNORE_SUFFIX)) {
> + ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_TAGS, url_ftell(s->pb));
> + if (ret < 0) return ret;
> +
> + tags = start_ebml_master(s->pb, MATROSKA_ID_TAGS, 0);
> +
> + while ((t = av_metadata_get(s->metadata, "", t, AV_METADATA_IGNORE_SUFFIX)))
Don't need the extra () here or down further.
More information about the ffmpeg-devel
mailing list