On Tue, Aug 26, 2008 at 09:59:12AM -0700, Baptiste Coudurier wrote:
> zhentan feng wrote:
> > [...]
> >
> > +
> > +    mxf_write_local_tag(pb, company_name_len, 0x3C01);
> > +    put_buffer(pb, "FFmpeg", company_name_len);
> 
> Sorry for noticing it so late, but this is wrong, all strings in MXF are
> in UTF-16.

Ok, so I finally decided to look at it myself (should have done it the
first time - nobody else seems to have bothered to check it during the
discussion).
First, more precisely it is UTF-16BE.
Secondly, there (expectedly) is no need to 0-terminate the strings, so
strlen would have been better than sizeof (saving a few bytes).
Not that I think UTF-16 is even remotely a good choice they made there,
and then not even making it compatible to the only other big user of it
(Windows, which uses UTF-16LE).
I also have to ask: Are you sure all strings are UTF-16? The way they
express themselves in section 3.3 of 377m is extremely unclear to me:
"
Strings Strings are created from individual characters defined either as ISO 
7-bit characters (as
        used in SMPTE RP210) requiring 1 byte per character, or as Unicode 
UTF-16 characters
        requiring 2 bytes per character. In the case of UTF-16 characters 
expressing ISO 7-bit
        characters, an inspection of every byte will show each 2-byte pair as a 
null byte and a
        character byte. Byte order is specified as fixed big endian. The number 
of bytes allocated
        to this string is given by the KLV encoding. There is no requirement to 
terminate each
        string with a zero value. However, if the length of the String 
information is less than the
        space allocated, the string shall be terminated with a zero value
"

Which sounds as if they could be either - though the tables all seem to
say UTF16...

Greetings,
Reimar Döffinger
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to