Revision 01f4895c libavformat/img.c

View differences:

libavformat/img.c
134 134
        s->is_pipe = 1;
135 135

  
136 136
    if (!ap || !ap->time_base.num) {
137
        st->codec.time_base= (AVRational){1,25};
137
        st->codec->time_base= (AVRational){1,25};
138 138
    } else {
139
        st->codec.time_base= ap->time_base;
139
        st->codec->time_base= ap->time_base;
140 140
    }
141 141
 
142 142
    if (!s->is_pipe) {
......
166 166
        url_fseek(f, 0, SEEK_SET);
167 167
    }
168 168
    
169
    st->codec.codec_type = CODEC_TYPE_VIDEO;
170
    st->codec.codec_id = CODEC_ID_RAWVIDEO;
171
    st->codec.width = s->width;
172
    st->codec.height = s->height;
173
    st->codec.pix_fmt = s->pix_fmt;
169
    st->codec->codec_type = CODEC_TYPE_VIDEO;
170
    st->codec->codec_id = CODEC_ID_RAWVIDEO;
171
    st->codec->width = s->width;
172
    st->codec->height = s->height;
173
    st->codec->pix_fmt = s->pix_fmt;
174 174
    s->img_size = avpicture_get_size(s->pix_fmt, (s->width+15)&(~15), (s->height+15)&(~15));
175 175

  
176 176
    return 0;
......
232 232
    } else {
233 233
        /* XXX: computing this pts is not necessary as it is done in
234 234
           the generic code too */
235
        pkt->pts = av_rescale((int64_t)s->img_count * s1->streams[0]->codec.time_base.num, s1->streams[0]->time_base.den, s1->streams[0]->codec.time_base.den) / s1->streams[0]->time_base.num;
235
        pkt->pts = av_rescale((int64_t)s->img_count * s1->streams[0]->codec->time_base.num, s1->streams[0]->time_base.den, s1->streams[0]->codec->time_base.den) / s1->streams[0]->time_base.num;
236 236
        s->img_count++;
237 237
        s->img_number++;
238 238
        return 0;
......
276 276
        return -1;
277 277
    img->img_fmt = img_fmt;
278 278
    img->pix_fmt = i;
279
    st->codec.pix_fmt = img->pix_fmt;
279
    st->codec->pix_fmt = img->pix_fmt;
280 280
    return 0;
281 281
}
282 282

  
......
306 306
    char filename[1024];
307 307
    AVImageInfo info;
308 308

  
309
    width = st->codec.width;
310
    height = st->codec.height;
309
    width = st->codec->width;
310
    height = st->codec->height;
311 311
    
312 312
    picture = (AVPicture *)pkt->data;
313 313

  
......
323 323
    }
324 324
    info.width = width;
325 325
    info.height = height;
326
    info.pix_fmt = st->codec.pix_fmt;
326
    info.pix_fmt = st->codec->pix_fmt;
327 327
    info.interleaved = 0;    /* FIXME: there should be a way to set it right */
328 328
    info.pict = *picture;
329 329
    ret = av_write_image(pb, img->img_fmt, &info);

Also available in: Unified diff