Revision 01f4895c libavformat/amr.c

View differences:

libavformat/amr.c
31 31
static int amr_write_header(AVFormatContext *s)
32 32
{
33 33
    ByteIOContext *pb = &s->pb;
34
    AVCodecContext *enc = &s->streams[0]->codec;
34
    AVCodecContext *enc = s->streams[0]->codec;
35 35

  
36 36
    s->priv_data = NULL;
37 37

  
......
100 100
            return AVERROR_NOMEM;
101 101
        }
102 102
    
103
        st->codec.codec_type = CODEC_TYPE_AUDIO;
104
        st->codec.codec_tag = MKTAG('s', 'a', 'w', 'b');
105
        st->codec.codec_id = CODEC_ID_AMR_WB;
106
        st->codec.channels = 1;
107
        st->codec.sample_rate = 16000;
103
        st->codec->codec_type = CODEC_TYPE_AUDIO;
104
        st->codec->codec_tag = MKTAG('s', 'a', 'w', 'b');
105
        st->codec->codec_id = CODEC_ID_AMR_WB;
106
        st->codec->channels = 1;
107
        st->codec->sample_rate = 16000;
108 108
    }
109 109
    else
110 110
    {
......
114 114
            return AVERROR_NOMEM;
115 115
        }
116 116
    
117
        st->codec.codec_type = CODEC_TYPE_AUDIO;
118
        st->codec.codec_tag = MKTAG('s', 'a', 'm', 'r');
119
        st->codec.codec_id = CODEC_ID_AMR_NB;
120
        st->codec.channels = 1;
121
        st->codec.sample_rate = 8000;
117
        st->codec->codec_type = CODEC_TYPE_AUDIO;
118
        st->codec->codec_tag = MKTAG('s', 'a', 'm', 'r');
119
        st->codec->codec_id = CODEC_ID_AMR_NB;
120
        st->codec->channels = 1;
121
        st->codec->sample_rate = 8000;
122 122
    }
123 123

  
124 124
    return 0;
......
129 129
static int amr_read_packet(AVFormatContext *s,
130 130
                          AVPacket *pkt)
131 131
{
132
    AVCodecContext *enc = &s->streams[0]->codec;
132
    AVCodecContext *enc = s->streams[0]->codec;
133 133

  
134 134
    if (enc->codec_id == CODEC_ID_AMR_NB)
135 135
    {

Also available in: Unified diff