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

Michael Niedermayer michaelni
Tue Feb 23 12:57:44 CET 2010


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


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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- 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/20100223/e2da42ef/attachment.pgp>



More information about the ffmpeg-devel mailing list