use strlen and do not write useless trailing 0 according to specs

Originally committed as revision 15057 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Baptiste Coudurier 2008-08-30 22:24:19 +00:00
parent 5f94b92077
commit 6b05863aa9
1 changed files with 4 additions and 4 deletions

View File

@ -329,7 +329,7 @@ static void mxf_write_preface(AVFormatContext *s)
*/
static void mxf_write_utf16(ByteIOContext *pb, const char *value)
{
int i, size = strlen(value)+1;
int i, size = strlen(value);
for (i = 0; i < size; i++)
put_be16(pb, value[i]);
}
@ -341,12 +341,12 @@ static void mxf_write_identification(AVFormatContext *s)
mxf_write_metadata_key(pb, 0x013000);
PRINT_KEY(s, "identification key", pb->buf_ptr - 16);
company_name_len = sizeof("FFmpeg") * 2;
product_name_len = sizeof("OP1a Muxer") * 2;
company_name_len = strlen("FFmpeg") * 2;
product_name_len = strlen("OP1a Muxer") * 2;
length = 80 + company_name_len + product_name_len;
if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
version_string_len = sizeof(LIBAVFORMAT_IDENT) * 2;
version_string_len = strlen(LIBAVFORMAT_IDENT) * 2;
length += 4 + version_string_len;
}
klv_encode_ber_length(pb, length);