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/flvdec.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/flvdec.c')
-rw-r--r-- | libavformat/flvdec.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 69257a5fc8..efe7230af5 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -60,7 +60,7 @@ static int flv_read_header(AVFormatContext *s, static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret, i, type, size, pts, flags, is_audio; - AVStream *st; + AVStream *st = NULL; for(;;){ url_fskip(&s->pb, 4); /* size of previous packet */ @@ -122,7 +122,12 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) else st->codec.sample_rate = (44100<<((flags>>2)&3))>>3; switch(flags >> 4){/* 0: uncompressed 1: ADPCM 2: mp3 5: Nellymoser 8kHz mono 6: Nellymoser*/ + case 0: if (flags&2) st->codec.codec_id = CODEC_ID_PCM_S16BE; + else st->codec.codec_id = CODEC_ID_PCM_S8; break; case 2: st->codec.codec_id = CODEC_ID_MP3; break; + // this is not listed at FLV but at SWF, strange... + case 3: if (flags&2) st->codec.codec_id = CODEC_ID_PCM_S16LE; + else st->codec.codec_id = CODEC_ID_PCM_S8; break; default: st->codec.codec_tag= (flags >> 4); } |