aboutsummaryrefslogtreecommitdiffstats
path: root/libav/avienc.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2001-09-24 23:26:46 +0000
committerFabrice Bellard <fabrice@bellard.org>2001-09-24 23:26:46 +0000
commit46a3d0685df667158628a8037faa0383f9bd4c22 (patch)
tree2beb53820c1270a5d56e0417a21a56c27ea89a29 /libav/avienc.c
parent96baaa6affc11ebd71b8f84c11086c92e1c7248b (diff)
downloadffmpeg-46a3d0685df667158628a8037faa0383f9bd4c22.tar.gz
correct pcm audio format handling
Originally committed as revision 147 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav/avienc.c')
-rw-r--r--libav/avienc.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/libav/avienc.c b/libav/avienc.c
index 8c5848d2e6..c971ef03ae 100644
--- a/libav/avienc.c
+++ b/libav/avienc.c
@@ -67,17 +67,6 @@ CodecTag codec_bmp_tags[] = {
{ 0, 0 },
};
-CodecTag codec_wav_tags[] = {
- { CODEC_ID_MP2, 0x55 },
- { CODEC_ID_MP2, 0x50 },
- { CODEC_ID_AC3, 0x2000 },
- { CODEC_ID_PCM_S16LE, 0x01 },
- { CODEC_ID_PCM_ALAW, 0x06 },
- { CODEC_ID_PCM_MULAW, 0x07 },
- { 0, 0 },
-};
-
-
unsigned int codec_get_tag(CodecTag *tags, int id)
{
while (tags->id != 0) {
@@ -120,22 +109,6 @@ void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc)
put_le32(pb, 0);
}
-/* WAVEFORMATEX header */
-void put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
-{
- int tag;
-
- tag = codec_get_tag(codec_wav_tags, enc->codec_id);
-
- put_le16(pb, tag);
- put_le16(pb, enc->channels);
- put_le32(pb, enc->sample_rate);
- put_le32(pb, enc->bit_rate / 8);
- put_le16(pb, 1); /* block align */
- put_le16(pb, 16); /* bits per sample */
- put_le16(pb, 0); /* wav_extra_size */
-}
-
static int avi_write_header(AVFormatContext *s)
{
AVIContext *avi;
@@ -247,7 +220,10 @@ static int avi_write_header(AVFormatContext *s)
put_bmp_header(pb, stream);
break;
case CODEC_TYPE_AUDIO:
- put_wav_header(pb, stream);
+ if (put_wav_header(pb, stream) < 0) {
+ free(avi);
+ return -1;
+ }
break;
}
end_tag(pb, strf);