Revision 01f4895c libavformat/swf.c

View differences:

libavformat/swf.c
324 324
    video_enc = NULL;
325 325
    audio_enc = NULL;
326 326
    for(i=0;i<s->nb_streams;i++) {
327
        enc = &s->streams[i]->codec;
327
        enc = s->streams[i]->codec;
328 328
        if (enc->codec_type == CODEC_TYPE_AUDIO)
329 329
            audio_enc = enc;
330 330
        else {
......
652 652

  
653 653
static int swf_write_packet(AVFormatContext *s, AVPacket *pkt)
654 654
{
655
    AVCodecContext *codec = &s->streams[pkt->stream_index]->codec;
655
    AVCodecContext *codec = s->streams[pkt->stream_index]->codec;
656 656
    if (codec->codec_type == CODEC_TYPE_AUDIO)
657 657
        return swf_write_audio(s, codec, pkt->data, pkt->size);
658 658
    else
......
668 668

  
669 669
    video_enc = NULL;
670 670
    for(i=0;i<s->nb_streams;i++) {
671
        enc = &s->streams[i]->codec;
671
        enc = s->streams[i]->codec;
672 672
        if (enc->codec_type == CODEC_TYPE_VIDEO)
673 673
            video_enc = enc;
674 674
    }
......
775 775
        if (tag < 0) {
776 776
            if ( ast || vst ) {
777 777
                if ( vst && ast ) {
778
                    vst->codec.time_base.den = ast->codec.sample_rate / swf->samples_per_frame;
779
                    vst->codec.time_base.num = 1;
778
                    vst->codec->time_base.den = ast->codec->sample_rate / swf->samples_per_frame;
779
                    vst->codec->time_base.num = 1;
780 780
                }
781 781
                break;
782 782
            }
......
794 794
                vst = av_new_stream(s, 0);
795 795
                av_set_pts_info(vst, 24, 1, 1000); /* 24 bit pts in ms */
796 796
    
797
                vst->codec.codec_type = CODEC_TYPE_VIDEO;
798
                vst->codec.codec_id = CODEC_ID_FLV1;
797
                vst->codec->codec_type = CODEC_TYPE_VIDEO;
798
                vst->codec->codec_id = CODEC_ID_FLV1;
799 799
                if ( swf->samples_per_frame ) {
800
                    vst->codec.time_base.den = 1000. / swf->ms_per_frame;
801
                    vst->codec.time_base.num = 1;
800
                    vst->codec->time_base.den = 1000. / swf->ms_per_frame;
801
                    vst->codec->time_base.num = 1;
802 802
                }
803 803
            }
804 804
        } else if ( ( tag == TAG_STREAMHEAD || tag == TAG_STREAMHEAD2 ) && !ast) {
......
819 819
                    return -ENOMEM;
820 820

  
821 821
                if (v & 0x01)
822
                    ast->codec.channels = 2;
822
                    ast->codec->channels = 2;
823 823
                else
824
                    ast->codec.channels = 1;
824
                    ast->codec->channels = 1;
825 825

  
826 826
                switch((v>> 2) & 0x03) {
827 827
                case 1:
828
                    ast->codec.sample_rate = 11025;
828
                    ast->codec->sample_rate = 11025;
829 829
                    break;
830 830
                case 2:
831
                    ast->codec.sample_rate = 22050;
831
                    ast->codec->sample_rate = 22050;
832 832
                    break;
833 833
                case 3:
834
                    ast->codec.sample_rate = 44100;
834
                    ast->codec->sample_rate = 44100;
835 835
                    break;
836 836
                default:
837 837
                    av_free(ast);
838 838
                    return AVERROR_IO;
839 839
                }
840
                ast->codec.codec_type = CODEC_TYPE_AUDIO;
841
                ast->codec.codec_id = CODEC_ID_MP3;
840
                ast->codec->codec_type = CODEC_TYPE_AUDIO;
841
                ast->codec->codec_id = CODEC_ID_MP3;
842 842
            }
843 843
        } else {
844 844
            url_fskip(pb, len);

Also available in: Unified diff