Revision 01f4895c output_example.c

View differences:

output_example.c
62 62
        exit(1);
63 63
    }
64 64

  
65
    c = &st->codec;
65
    c = st->codec;
66 66
    c->codec_id = codec_id;
67 67
    c->codec_type = CODEC_TYPE_AUDIO;
68 68

  
......
78 78
    AVCodecContext *c;
79 79
    AVCodec *codec;
80 80

  
81
    c = &st->codec;
81
    c = st->codec;
82 82

  
83 83
    /* find the audio encoder */
84 84
    codec = avcodec_find_encoder(c->codec_id);
......
106 106
       support to compute the input frame size in samples */
107 107
    if (c->frame_size <= 1) {
108 108
        audio_input_frame_size = audio_outbuf_size / c->channels;
109
        switch(st->codec.codec_id) {
109
        switch(st->codec->codec_id) {
110 110
        case CODEC_ID_PCM_S16LE:
111 111
        case CODEC_ID_PCM_S16BE:
112 112
        case CODEC_ID_PCM_U16LE:
......
145 145
    AVPacket pkt;
146 146
    av_init_packet(&pkt);
147 147
    
148
    c = &st->codec;
148
    c = st->codec;
149 149

  
150 150
    get_audio_frame(samples, audio_input_frame_size, c->channels);
151 151

  
......
165 165

  
166 166
void close_audio(AVFormatContext *oc, AVStream *st)
167 167
{
168
    avcodec_close(&st->codec);
168
    avcodec_close(st->codec);
169 169
    
170 170
    av_free(samples);
171 171
    av_free(audio_outbuf);
......
190 190
        exit(1);
191 191
    }
192 192
    
193
    c = &st->codec;
193
    c = st->codec;
194 194
    c->codec_id = codec_id;
195 195
    c->codec_type = CODEC_TYPE_VIDEO;
196 196

  
......
246 246
    AVCodec *codec;
247 247
    AVCodecContext *c;
248 248

  
249
    c = &st->codec;
249
    c = st->codec;
250 250

  
251 251
    /* find the video encoder */
252 252
    codec = avcodec_find_encoder(c->codec_id);
......
317 317
    int out_size, ret;
318 318
    AVCodecContext *c;
319 319
    
320
    c = &st->codec;
320
    c = st->codec;
321 321
    
322 322
    if (frame_count >= STREAM_NB_FRAMES) {
323 323
        /* no more frame to compress. The codec has a latency of a few
......
379 379

  
380 380
void close_video(AVFormatContext *oc, AVStream *st)
381 381
{
382
    avcodec_close(&st->codec);
382
    avcodec_close(st->codec);
383 383
    av_free(picture->data[0]);
384 384
    av_free(picture);
385 385
    if (tmp_picture) {

Also available in: Unified diff