diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-07-17 22:24:36 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-07-17 22:24:36 +0000 |
commit | 01f4895c682a1752bf6d138ffb0628470e16b85a (patch) | |
tree | 56a3dfce270dad38b97c8f7ff288cc23cfac54da /libavformat/flvdec.c | |
parent | 4c1a012e9ceb0840688c547625208e7c4b81624a (diff) | |
download | ffmpeg-01f4895c682a1752bf6d138ffb0628470e16b85a.tar.gz |
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
Originally committed as revision 4453 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/flvdec.c')
-rw-r--r-- | libavformat/flvdec.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 187a692ea9..b309c5b55f 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -102,7 +102,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) return AVERROR_NOMEM; av_set_pts_info(st, 24, 1, 1000); /* 24 bit pts in ms */ - st->codec.time_base= (AVRational){1,1000}; + st->codec->time_base= (AVRational){1,1000}; } // av_log(NULL, AV_LOG_DEBUG, "%d %X %d \n", is_audio, flags, st->discard); if( (st->discard >= AVDISCARD_NONKEY && !((flags >> 4)==1 || is_audio)) @@ -116,34 +116,34 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) } if(is_audio){ - if(st->codec.sample_rate == 0){ - st->codec.codec_type = CODEC_TYPE_AUDIO; - st->codec.channels = (flags&1)+1; + if(st->codec->sample_rate == 0){ + st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->channels = (flags&1)+1; if((flags >> 4) == 5) - st->codec.sample_rate= 8000; + st->codec->sample_rate= 8000; else - st->codec.sample_rate = (44100<<((flags>>2)&3))>>3; + 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 1: st->codec.codec_id = CODEC_ID_ADPCM_SWF; break; - case 2: st->codec.codec_id = CODEC_ID_MP3; break; + case 0: if (flags&2) st->codec->codec_id = CODEC_ID_PCM_S16BE; + else st->codec->codec_id = CODEC_ID_PCM_S8; break; + case 1: st->codec->codec_id = CODEC_ID_ADPCM_SWF; 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; + case 3: if (flags&2) st->codec->codec_id = CODEC_ID_PCM_S16LE; + else st->codec->codec_id = CODEC_ID_PCM_S8; break; default: av_log(s, AV_LOG_INFO, "Unsupported audio codec (%x)\n", flags >> 4); - st->codec.codec_tag= (flags >> 4); + st->codec->codec_tag= (flags >> 4); } - st->codec.bits_per_sample = (flags & 2) ? 16 : 8; + st->codec->bits_per_sample = (flags & 2) ? 16 : 8; } }else{ - st->codec.codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = CODEC_TYPE_VIDEO; switch(flags & 0xF){ - case 2: st->codec.codec_id = CODEC_ID_FLV1; break; + case 2: st->codec->codec_id = CODEC_ID_FLV1; break; default: av_log(s, AV_LOG_INFO, "Unsupported video codec (%x)\n", flags & 0xf); - st->codec.codec_tag= flags & 0xF; + st->codec->codec_tag= flags & 0xF; } } |