diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2005-02-21 18:05:21 +0000 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2005-02-21 18:05:21 +0000 |
commit | 923bd441fed9d87a3dd2af5f100f99b392cfaff3 (patch) | |
tree | 2b3e25df9a08b7d1f445bab79f30d41a9dc56172 /libavformat/flvenc.c | |
parent | 58aa2b1d351695de8ac0fffbd04638f256ded35e (diff) | |
download | ffmpeg-923bd441fed9d87a3dd2af5f100f99b392cfaff3.tar.gz |
correct pcm in flv handling
Originally committed as revision 3968 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/flvenc.c')
-rw-r--r-- | libavformat/flvenc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 7f86036e73..500d4220d7 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -35,7 +35,7 @@ static void put_be24(ByteIOContext *pb, int value) } static int get_audio_flags(AVCodecContext *enc){ - int flags = 0x02; + int flags = 0; switch (enc->sample_rate) { case 44100: @@ -61,8 +61,16 @@ static int get_audio_flags(AVCodecContext *enc){ switch(enc->codec_id){ case CODEC_ID_MP3: - flags |= 0x20; + flags |= 0x20 | 0x2; break; + case CODEC_ID_PCM_S8: + break; + case CODEC_ID_PCM_S16BE: + flags |= 0x60 | 0x2; + break; + case CODEC_ID_PCM_S16LE: + flags |= 0x2; + break; case 0: flags |= enc->codec_tag<<4; break; @@ -155,8 +163,8 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) put_be32(pb,flv->reserved); put_byte(pb,flags); put_buffer(pb, pkt->data, size); - put_be32(pb,size+1+11); // reserved - + put_be32(pb,size+1+11); // previous tag size + put_flush_packet(pb); return 0; } |