OSDN Git Service

MPEG4Writer: Write a zero-length compressor string
authorMartin Storsjo <martin@martin.st>
Wed, 30 Jan 2013 16:45:30 +0000 (18:45 +0200)
committerMartin Storsjo <martin@martin.st>
Thu, 31 Jan 2013 09:22:35 +0000 (11:22 +0200)
The first byte is the number of bytes in the string to display,
the rest is the actual string (see ISO/IEC 14496-12:2008 page 29,
compressorname in VisualSampleEntry) to display. Currently, all 31
space characters are displayed in certain players (such as Apple
QuickTime Player) instead of the plain codec name (e.g. "H.264").
By writing the string length properly, the actual content of the
remaining 31 bytes is ignored instead of displayed.

Change-Id: I7f93a8966d74a4e86abc46c3dcb70f71780d9cd6

media/libstagefright/MPEG4Writer.cpp

index 8b52e15..326930f 100755 (executable)
@@ -2558,7 +2558,8 @@ void MPEG4Writer::Track::writeVideoFourCCBox() {
     mOwner->writeInt32(0x480000);    // vert resolution
     mOwner->writeInt32(0);           // reserved
     mOwner->writeInt16(1);           // frame count
-    mOwner->write("                                ", 32);
+    mOwner->writeInt8(0);            // compressor string length
+    mOwner->write("                               ", 31);
     mOwner->writeInt16(0x18);        // depth
     mOwner->writeInt16(-1);          // predefined