diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-02-02 04:40:57 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-02-02 04:40:57 +0000 |
commit | 0290074c31fbe3b595e49f9dc144d0b1a5cbeafa (patch) | |
tree | 30e0fd5124aa454150149cd054145935bd5c338b | |
parent | f9303ffd62403b470acb77fc0e26ba1b02c873cf (diff) | |
download | ffmpeg-0290074c31fbe3b595e49f9dc144d0b1a5cbeafa.tar.gz |
factorize common wav local tags
Originally committed as revision 16932 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/mxfenc.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 0c04f7d6f9..50177e4d00 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -680,11 +680,11 @@ static void mxf_write_generic_sound_desc(AVFormatContext *s, AVStream *st, const 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(AVFormatContext *s, AVStream *st) 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) |