Browse code

wtvenc: use ff_put_guid and remove local copy of this function

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Peter Ross authored on 2011/11/05 14:09:47
Showing 2 changed files
... ...
@@ -317,7 +317,7 @@ OBJS-$(CONFIG_WSAUD_DEMUXER)             += westwood.o
317 317
 OBJS-$(CONFIG_WSVQA_DEMUXER)             += westwood.o
318 318
 OBJS-$(CONFIG_WTV_DEMUXER)               += wtvdec.o wtv.o asfdec.o asf.o asfcrypt.o \
319 319
                                             avlanguage.o mpegts.o isom.o riff.o
320
-OBJS-$(CONFIG_WTV_MUXER)                 += wtvenc.o wtv.o asf.o riff.o
320
+OBJS-$(CONFIG_WTV_MUXER)                 += wtvenc.o wtv.o asf.o asfenc.o riff.o
321 321
 OBJS-$(CONFIG_WV_DEMUXER)                += wv.o apetag.o
322 322
 OBJS-$(CONFIG_XA_DEMUXER)                += xa.o
323 323
 OBJS-$(CONFIG_XBIN_DEMUXER)              += bintext.o sauce.o
... ...
@@ -30,6 +30,7 @@
30 30
 #include "avformat.h"
31 31
 #include "internal.h"
32 32
 #include "wtv.h"
33
+#include "asf.h"
33 34
 
34 35
 #define WTV_BIGSECTOR_SIZE (1 << WTV_BIGSECTOR_BITS)
35 36
 #define INDEX_BASE 0x2
... ...
@@ -112,12 +113,6 @@ static int write_pad(AVIOContext *pb, int size)
112 112
     return 0;
113 113
 }
114 114
 
115
-static void put_guid(AVIOContext *s, const ff_asf_guid *g)
116
-{
117
-    assert(sizeof(*g) == 16);
118
-    avio_write(s, *g, sizeof(*g));
119
- }
120
-
121 115
 static const ff_asf_guid *get_codec_guid(enum CodecID id, const AVCodecGuid *av_guid)
122 116
 {
123 117
     int i;
... ...
@@ -137,7 +132,7 @@ static void write_chunk_header(AVFormatContext *s, const ff_asf_guid *guid, int
137 137
     AVIOContext *pb = s->pb;
138 138
 
139 139
     wctx->last_chunk_pos = avio_tell(pb) - wctx->timeline_start_pos;
140
-    put_guid(pb, guid);
140
+    ff_put_guid(pb, guid);
141 141
     avio_wl32(pb, 32 + length);
142 142
     avio_wl32(pb, stream_id);
143 143
     avio_wl64(pb, wctx->serial);
... ...
@@ -190,7 +185,7 @@ static void write_index(AVFormatContext *s)
190 190
 
191 191
     for (i = 0; i < wctx->nb_index; i++) {
192 192
         WtvChunkEntry *t = wctx->index + i;
193
-        put_guid(pb,  t->guid);
193
+        ff_put_guid(pb,  t->guid);
194 194
         avio_wl64(pb, t->pos);
195 195
         avio_wl32(pb, t->stream_id);
196 196
         avio_wl32(pb, 0); // checksum?
... ...
@@ -234,10 +229,10 @@ static int write_stream_codec_info(AVFormatContext *s, AVStream *st)
234 234
         return -1;
235 235
     }
236 236
 
237
-    put_guid(pb, media_type); // mediatype
238
-    put_guid(pb, &ff_mediasubtype_cpfilters_processed); // subtype
237
+    ff_put_guid(pb, media_type); // mediatype
238
+    ff_put_guid(pb, &ff_mediasubtype_cpfilters_processed); // subtype
239 239
     write_pad(pb, 12);
240
-    put_guid(pb,&ff_format_cpfilters_processed); // format type
240
+    ff_put_guid(pb,&ff_format_cpfilters_processed); // format type
241 241
     avio_wl32(pb, 0); // size
242 242
 
243 243
     hdr_pos_start = avio_tell(pb);
... ...
@@ -258,8 +253,8 @@ static int write_stream_codec_info(AVFormatContext *s, AVStream *st)
258 258
     avio_seek(pb, -(hdr_size + 4), SEEK_CUR);
259 259
     avio_wl32(pb, hdr_size + 32);
260 260
     avio_seek(pb, hdr_size, SEEK_CUR);
261
-    put_guid(pb, g);           // actual_subtype
262
-    put_guid(pb, format_type); // actual_formattype
261
+    ff_put_guid(pb, g);           // actual_subtype
262
+    ff_put_guid(pb, format_type); // actual_formattype
263 263
 
264 264
     return 0;
265 265
 }
... ...
@@ -344,8 +339,8 @@ static int write_header(AVFormatContext *s)
344 344
     int i, pad, ret;
345 345
     AVStream *st;
346 346
 
347
-    put_guid(pb, &ff_wtv_guid);
348
-    put_guid(pb, &sub_wtv_guid);
347
+    ff_put_guid(pb, &ff_wtv_guid);
348
+    ff_put_guid(pb, &sub_wtv_guid);
349 349
 
350 350
     avio_wl32(pb, 0x01);
351 351
     avio_wl32(pb, 0x02);
... ...
@@ -498,7 +493,7 @@ static int write_root_table(AVFormatContext *s, int64_t sector_pos)
498 498
         int len = 0;
499 499
         int64_t len_pos;
500 500
 
501
-        put_guid(pb, &ff_dir_entry_guid);
501
+        ff_put_guid(pb, &ff_dir_entry_guid);
502 502
         len_pos = avio_tell(pb);
503 503
         avio_wl16(pb, 40 + h->header_size + filename_padding + 8); // maybe updated later
504 504
         write_pad(pb, 6);
... ...
@@ -572,7 +567,7 @@ static void write_table_entries_events(AVFormatContext *s)
572 572
 
573 573
 static void write_tag(AVIOContext *pb, const char *key, const char *value)
574 574
 {
575
-    put_guid(pb, &ff_metadata_guid);
575
+    ff_put_guid(pb, &ff_metadata_guid);
576 576
     avio_wl32(pb, 1);
577 577
     avio_wl32(pb, strlen(value)*2 + 2);
578 578
     avio_put_str16le(pb, key);