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/swf.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/swf.c')
-rw-r--r-- | libavformat/swf.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/libavformat/swf.c b/libavformat/swf.c index c8988bf5f7..923a4f9934 100644 --- a/libavformat/swf.c +++ b/libavformat/swf.c @@ -324,7 +324,7 @@ static int swf_write_header(AVFormatContext *s) video_enc = NULL; audio_enc = NULL; for(i=0;i<s->nb_streams;i++) { - enc = &s->streams[i]->codec; + enc = s->streams[i]->codec; if (enc->codec_type == CODEC_TYPE_AUDIO) audio_enc = enc; else { @@ -652,7 +652,7 @@ static int swf_write_audio(AVFormatContext *s, static int swf_write_packet(AVFormatContext *s, AVPacket *pkt) { - AVCodecContext *codec = &s->streams[pkt->stream_index]->codec; + AVCodecContext *codec = s->streams[pkt->stream_index]->codec; if (codec->codec_type == CODEC_TYPE_AUDIO) return swf_write_audio(s, codec, pkt->data, pkt->size); else @@ -668,7 +668,7 @@ static int swf_write_trailer(AVFormatContext *s) video_enc = NULL; for(i=0;i<s->nb_streams;i++) { - enc = &s->streams[i]->codec; + enc = s->streams[i]->codec; if (enc->codec_type == CODEC_TYPE_VIDEO) video_enc = enc; } @@ -775,8 +775,8 @@ static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap) if (tag < 0) { if ( ast || vst ) { if ( vst && ast ) { - vst->codec.time_base.den = ast->codec.sample_rate / swf->samples_per_frame; - vst->codec.time_base.num = 1; + vst->codec->time_base.den = ast->codec->sample_rate / swf->samples_per_frame; + vst->codec->time_base.num = 1; } break; } @@ -794,11 +794,11 @@ static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap) vst = av_new_stream(s, 0); av_set_pts_info(vst, 24, 1, 1000); /* 24 bit pts in ms */ - vst->codec.codec_type = CODEC_TYPE_VIDEO; - vst->codec.codec_id = CODEC_ID_FLV1; + vst->codec->codec_type = CODEC_TYPE_VIDEO; + vst->codec->codec_id = CODEC_ID_FLV1; if ( swf->samples_per_frame ) { - vst->codec.time_base.den = 1000. / swf->ms_per_frame; - vst->codec.time_base.num = 1; + vst->codec->time_base.den = 1000. / swf->ms_per_frame; + vst->codec->time_base.num = 1; } } } else if ( ( tag == TAG_STREAMHEAD || tag == TAG_STREAMHEAD2 ) && !ast) { @@ -819,26 +819,26 @@ static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap) return -ENOMEM; if (v & 0x01) - ast->codec.channels = 2; + ast->codec->channels = 2; else - ast->codec.channels = 1; + ast->codec->channels = 1; switch((v>> 2) & 0x03) { case 1: - ast->codec.sample_rate = 11025; + ast->codec->sample_rate = 11025; break; case 2: - ast->codec.sample_rate = 22050; + ast->codec->sample_rate = 22050; break; case 3: - ast->codec.sample_rate = 44100; + ast->codec->sample_rate = 44100; break; default: av_free(ast); return AVERROR_IO; } - ast->codec.codec_type = CODEC_TYPE_AUDIO; - ast->codec.codec_id = CODEC_ID_MP3; + ast->codec->codec_type = CODEC_TYPE_AUDIO; + ast->codec->codec_id = CODEC_ID_MP3; } } else { url_fskip(pb, len); |