[FFmpeg-devel] [PATCH] asf - read/write metadata as UTF-16

Michael Niedermayer michaelni
Thu Feb 25 17:12:50 CET 2010


On Wed, Feb 24, 2010 at 11:06:32PM +0100, Anton Khirnov wrote:
> On Tue, Feb 23, 2010 at 12:57:44PM +0100, Michael Niedermayer wrote:
> > On Tue, Feb 23, 2010 at 08:03:07AM +0100, Anton Khirnov wrote:
> > > On Mon, Feb 22, 2010 at 11:51:37PM +0100, Michael Niedermayer wrote:
> > > > On Mon, Feb 22, 2010 at 11:12:14PM +0100, Anton Khirnov wrote:
> > > > > On Mon, Feb 22, 2010 at 08:18:53PM +0100, Michael Niedermayer wrote:
> > > > > >
> > > > > > > diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
> > > > > > > index b24baaf..5f584a2 100644
> > > > > > > --- a/libavformat/asfenc.c
> > > > > > > +++ b/libavformat/asfenc.c
> > > > > > > @@ -345,10 +345,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
> > > > > > >          hpos = put_header(pb, &ff_asf_extended_content_header);
> > > > > > >          put_le16(pb, metadata_count);
> > > > > > >          while ((tag = av_metadata_get(s->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
> > > > > > > -            put_le16(pb, 2*(strlen(tag->key) + 4));
> > > > > > > -            put_le16(pb, 'W');
> > > > > > > -            put_le16(pb, 'M');
> > > > > > > -            put_le16(pb, '/');
> > > > > > > +            put_le16(pb, 2*(strlen(tag->key) + 1));
> > > > > > 
> > > > > > thats storing a different length than it did before
> > > > > > no doubt the one before was wrong but this doesnt belong in this patch
> > > > > > and the new looks at least suspicous as thats strlen of utf8
> > > > > > 
> > > > > huh? i just removed the 'WM/' prefix => length decreased by 2*3.
> > > > 
> > > > ill skip the math
> > > > first is even second is odd no change to strlen can do this
> > > > 
> > > err no, both are even. sorry, i really don't see where the problem is.
> > 
> > argh, i managed to misread it as 2*strlen(tag->key) + 1 ;)
> > /me goes and cleans his glasses
> 
> so are the remaining two patches ok, or you're still reviewing them?
> 
> Anton Khirnov

>  asfenc.c |   27 ++++++++++++---------------
>  1 file changed, 12 insertions(+), 15 deletions(-)
> ea1ebf8817d6fd46e66eed88720029b152deba1c  0001-asfenc-simplify-writing-of-comment-header.patch
> From fbd0afddf4690238e455b07b38c629f3437af975 Mon Sep 17 00:00:00 2001
> From: Anton Khirnov <wyskas at gmail.com>
> Date: Mon, 22 Feb 2010 14:01:00 +0100
> Subject: [PATCH 1/2] asfenc: simplify writing of comment header.

ok


>  asfenc.c |   76 ++++++++++++++++++++++++++++++++++++++++++++++++---------------
>  1 file changed, 59 insertions(+), 17 deletions(-)
> 52baae84d68af7c99913e192200e8bce77096214  0002-asfenc-write-tags-in-proper-UTF-16.patch
> From 9b3d406168ce6829c7ca7041e37f14540156e7f4 Mon Sep 17 00:00:00 2001
> From: Anton Khirnov <wyskas at gmail.com>
> Date: Sun, 21 Feb 2010 17:57:17 +0100
> Subject: [PATCH 2/2] asfenc: write tags in proper UTF-16.

ok if tested

[..]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100225/2cd71d14/attachment.pgp>



More information about the ffmpeg-devel mailing list