aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mxfenc.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-08-30 22:32:23 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-08-30 22:32:23 +0000
commit9fedbc89107b9c7d6757e1947cb90857d8f73a24 (patch)
treea7661797672414a7b63ede01f47b09fa5568bd8d /libavformat/mxfenc.c
parent6b05863aa986f5c0dcee6096a92ac0c4ff81e406 (diff)
downloadffmpeg-9fedbc89107b9c7d6757e1947cb90857d8f73a24.tar.gz
introduce mxf_write_local_tag_utf16 and factorize
Originally committed as revision 15058 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r--libavformat/mxfenc.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 013634da5d..0bb90f5c7d 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -325,11 +325,12 @@ static void mxf_write_preface(AVFormatContext *s)
}
/*
- * Write an ascii string as utf-16
+ * Write a local tag containing an ascii string as utf-16
*/
-static void mxf_write_utf16(ByteIOContext *pb, const char *value)
+static void mxf_write_local_tag_utf16(ByteIOContext *pb, int tag, const char *value)
{
int i, size = strlen(value);
+ mxf_write_local_tag(pb, size*2, tag);
for (i = 0; i < size; i++)
put_be16(pb, value[i]);
}
@@ -359,16 +360,10 @@ static void mxf_write_identification(AVFormatContext *s)
mxf_write_local_tag(pb, 16, 0x3C09);
mxf_write_uuid(pb, Identification, 1);
- mxf_write_local_tag(pb, company_name_len, 0x3C01);
- mxf_write_utf16(pb, "FFmpeg");
-
- mxf_write_local_tag(pb, product_name_len, 0x3C02);
- mxf_write_utf16(pb, "OP1a Muxer");
-
- if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
- mxf_write_local_tag(pb, version_string_len, 0x3C04);
- mxf_write_utf16(pb, LIBAVFORMAT_IDENT);
- }
+ mxf_write_local_tag_utf16(pb, 0x3C01, "FFmpeg"); // Company Name
+ mxf_write_local_tag_utf16(pb, 0x3C02, "OP1a Muxer"); // Product Name
+ if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
+ mxf_write_local_tag_utf16(pb, 0x3C04, LIBAVFORMAT_IDENT); // Version String
// write product uid
mxf_write_local_tag(pb, 16, 0x3C05);