[Live-devel] parseGeneralConfigStr

Němec Alexandr a.nemec at atlas.cz
Wed Jan 6 05:30:39 PST 2010


An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20100106/80f7125b/attachment.html>
-------------- next part --------------
Dear all,
why does the parseGeneralConfigStr function (used for parsing the MPEG4 configuration header) return one more byte than I would expect?
Having a configuration string C the resulting byte array should have strlen(C)/2 bytes. Of course, if strlen(C) is odd (which should normally not be the case) it is safe to calculate the number of bytes as (strlen(C)+1)/2 which gives the same result for even numbers. But in the code the number of bytes is calculated as configSize = (strlen(configStr)+1)/2 + 1, which seems to leave one byte in the resulting byte array untouched filled with garbage. We discovered this issue after comparing the MPEG4 configuration bytes from live555 code with the data that we parsed out manually of a MPEG4 bitstream. MPEG4 decoders will not complain about this garbage byte, but I am correct that the last byte produced by the parseGeneralConfigStr function does not belong to the configuration header or am I completely wrong?
Thanks
Alex


More information about the live-devel mailing list