[FFmpeg-devel] [PATCH] matroskaenc: write tags.

Anton Khirnov wyskas
Sun Aug 22 16:15:54 CEST 2010


On Mon, Apr 12, 2010 at 06:46:54PM -0400, David Conrad wrote:
> 
> Anyway, after reading the specs again, the key must be in all uppercase.
I've sent a separate patch for that in the 'adding callbacks to metadata
conversion' thread
> Also, tag languages should be handled, e.g. from http://samples.mplayerhq.hu/V-codecs/SVQ3/shrek2_tsr_qt_480.mov
done
> 
> > +static int mkv_write_tags(AVFormatContext *s)
> > +{
> > +    MatroskaMuxContext *mkv = s->priv_data;
> > +    ebml_master        tags = {0};
> > +    int i, ret;
> > +
> > +    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);
> > +
> > +        mkv_write_tag(s->pb, s->metadata, 0, 0);
> > +    }
> > +
> > +    for (i = 0; i < s->nb_streams; i++) {
> > +        AVStream *st = s->streams[i];
> > +
> > +        if (!av_metadata_get(st->metadata, "", 0, AV_METADATA_IGNORE_SUFFIX))
> > +            continue;
> > +
> > +        if (!tags.pos) {
> > +            ret = mkv_add_seekhead_entry(mkv->cluster_seekhead, MATROSKA_ID_TAGS, url_ftell(s->pb));
> > +            if (ret < 0) return ret;
> > +
> > +            tags = start_ebml_master(s->pb, MATROSKA_ID_TAGS, 0);
> > +        }
> 
> Conditionally starting the tags master should be moved into mkv_write_tag rather than be duplicated 3x.
done

Anton Khirnov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-matroskaenc-write-tags.patch
Type: text/x-diff
Size: 4339 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100822/f23918e6/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100822/f23918e6/attachment.pgp>



More information about the ffmpeg-devel mailing list