aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2010-02-24 18:09:49 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2010-02-24 18:09:49 +0000
commit531d8fa3087101d62400273416d8d5f83c062534 (patch)
tree10296462af28ab4226d57b4625c63e03c0c6efba
parentae529ddb329952fa61aa1cbaae660580dc9f7c55 (diff)
downloadffmpeg-531d8fa3087101d62400273416d8d5f83c062534.tar.gz
Eliminate put_str16().
Patch by Anton Khirnov <wyskas gmail com>. Originally committed as revision 22031 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/asfenc.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index cea7180e50..b24baafdec 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -203,13 +203,6 @@ static void put_guid(ByteIOContext *s, const ff_asf_guid *g)
put_buffer(s, *g, sizeof(*g));
}
-static void put_str16_nolen(ByteIOContext *s, const char *tag);
-static void put_str16(ByteIOContext *s, const char *tag)
-{
- put_le16(s,strlen(tag) + 1);
- put_str16_nolen(s, tag);
-}
-
static void put_str16_nolen(ByteIOContext *s, const char *tag)
{
int c;
@@ -449,6 +442,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
put_le32(pb, s->nb_streams);
for(n=0;n<s->nb_streams;n++) {
AVCodec *p;
+ const char *desc;
enc = s->streams[n]->codec;
p = avcodec_find_encoder(enc->codec_id);
@@ -461,9 +455,11 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
put_le16(pb, -1);
if(enc->codec_id == CODEC_ID_WMAV2)
- put_str16(pb, "Windows Media Audio V8");
+ desc = "Windows Media Audio V8";
else
- put_str16(pb, p ? p->name : enc->codec_name);
+ desc = p ? p->name : enc->codec_name;
+ put_le16(pb, strlen(desc) + 1); // "number of characters" = length in bytes / 2
+ put_str16_nolen(pb, desc);
put_le16(pb, 0); /* no parameters */