[FFmpeg-cvslog] r16932 - trunk/libavformat/mxfenc.c

bcoudurier subversion
Mon Feb 2 05:40:58 CET 2009


Author: bcoudurier
Date: Mon Feb  2 05:40:57 2009
New Revision: 16932

Log:
factorize common wav local tags

Modified:
   trunk/libavformat/mxfenc.c

Modified: trunk/libavformat/mxfenc.c
==============================================================================
--- trunk/libavformat/mxfenc.c	Mon Feb  2 05:36:54 2009	(r16931)
+++ trunk/libavformat/mxfenc.c	Mon Feb  2 05:40:57 2009	(r16932)
@@ -680,11 +680,11 @@ static void mxf_write_generic_sound_desc
     put_be32(pb, st->codec->bits_per_coded_sample);
 }
 
-static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st)
+static void mxf_write_wav_common_desc(AVFormatContext *s, AVStream *st, const UID key, unsigned size)
 {
     ByteIOContext *pb = s->pb;
 
-    mxf_write_generic_sound_desc(s, st, mxf_wav_descriptor_key, 107);
+    mxf_write_generic_sound_desc(s, st, key, size);
 
     mxf_write_local_tag(pb, 2, 0x3D0A);
     put_be16(pb, st->codec->block_align);
@@ -694,18 +694,14 @@ static void mxf_write_wav_desc(AVFormatC
     put_be32(pb, st->codec->block_align*st->codec->sample_rate);
 }
 
-static void mxf_write_aes3_desc(AVFormatContext *s, AVStream *st)
+static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st)
 {
-    ByteIOContext *pb = s->pb;
-
-    mxf_write_generic_sound_desc(s, st, mxf_aes3_descriptor_key, 107);
-
-    mxf_write_local_tag(pb, 2, 0x3D0A);
-    put_be16(pb, st->codec->block_align);
+    mxf_write_wav_common_desc(s, st, mxf_wav_descriptor_key, 107);
+}
 
-    // avg bytes per sec
-    mxf_write_local_tag(pb, 4, 0x3D09);
-    put_be32(pb, st->codec->block_align*st->codec->sample_rate);
+static void mxf_write_aes3_desc(AVFormatContext *s, AVStream *st)
+{
+    mxf_write_wav_common_desc(s, st, mxf_aes3_descriptor_key, 107);
 }
 
 static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType type)




More information about the ffmpeg-cvslog mailing list