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

Ronald S. Bultje rsbultje
Wed Feb 24 19:21:10 CET 2010


Hi,

On Tue, Feb 23, 2010 at 6:57 AM, Michael Niedermayer <michaelni at gmx.at> 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

Applied then.

Ronald



More information about the ffmpeg-devel mailing list