[FFmpeg-cvslog] r22031 - trunk/libavformat/asfenc.c

rbultje subversion
Wed Feb 24 19:09:49 CET 2010


Author: rbultje
Date: Wed Feb 24 19:09:49 2010
New Revision: 22031

Log:
Eliminate put_str16().

Patch by Anton Khirnov <wyskas gmail com>.

Modified:
   trunk/libavformat/asfenc.c

Modified: trunk/libavformat/asfenc.c
==============================================================================
--- trunk/libavformat/asfenc.c	Wed Feb 24 19:08:30 2010	(r22030)
+++ trunk/libavformat/asfenc.c	Wed Feb 24 19:09:49 2010	(r22031)
@@ -203,13 +203,6 @@ static void put_guid(ByteIOContext *s, c
     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(AVFormatCon
     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(AVFormatCon
             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 */
 
 



More information about the ffmpeg-cvslog mailing list