Revision 01f4895c libavformat/matroska.c

View differences:

libavformat/matroska.c
2273 2273
                return AVERROR_NOMEM;
2274 2274
            av_set_pts_info(st, 24, 1, 1000); /* 24 bit pts in ms */
2275 2275

  
2276
            st->codec.codec_id = codec_id;
2276
            st->codec->codec_id = codec_id;
2277 2277

  
2278 2278
            if(extradata){
2279
                st->codec.extradata = extradata;
2280
                st->codec.extradata_size = extradata_size;
2279
                st->codec->extradata = extradata;
2280
                st->codec->extradata_size = extradata_size;
2281 2281
            } else if(track->codec_priv && track->codec_priv_size > 0){
2282
                st->codec.extradata = av_malloc(track->codec_priv_size);
2283
                if(st->codec.extradata == NULL)
2282
                st->codec->extradata = av_malloc(track->codec_priv_size);
2283
                if(st->codec->extradata == NULL)
2284 2284
                    return AVERROR_NOMEM;
2285
                st->codec.extradata_size = track->codec_priv_size;
2286
                memcpy(st->codec.extradata, track->codec_priv,
2285
                st->codec->extradata_size = track->codec_priv_size;
2286
                memcpy(st->codec->extradata, track->codec_priv,
2287 2287
                       track->codec_priv_size);
2288 2288
            }
2289 2289

  
2290 2290
            if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
2291 2291
                MatroskaVideoTrack *videotrack = (MatroskaVideoTrack *)track;
2292 2292

  
2293
                st->codec.codec_type = CODEC_TYPE_VIDEO;
2294
                st->codec.codec_tag = videotrack->fourcc;
2295
                st->codec.width = videotrack->pixel_width;
2296
                st->codec.height = videotrack->pixel_height;
2293
                st->codec->codec_type = CODEC_TYPE_VIDEO;
2294
                st->codec->codec_tag = videotrack->fourcc;
2295
                st->codec->width = videotrack->pixel_width;
2296
                st->codec->height = videotrack->pixel_height;
2297 2297
                if (videotrack->display_width == 0)
2298
                    st->codec.sample_aspect_ratio.num =
2298
                    st->codec->sample_aspect_ratio.num =
2299 2299
                        videotrack->pixel_width;
2300 2300
                else
2301
                    st->codec.sample_aspect_ratio.num =
2301
                    st->codec->sample_aspect_ratio.num =
2302 2302
                        videotrack->display_width;
2303 2303
                if (videotrack->display_height == 0)
2304
                    st->codec.sample_aspect_ratio.num =
2304
                    st->codec->sample_aspect_ratio.num =
2305 2305
                        videotrack->pixel_height;
2306 2306
                else
2307
                    st->codec.sample_aspect_ratio.num =
2307
                    st->codec->sample_aspect_ratio.num =
2308 2308
                        videotrack->display_height;
2309 2309

  
2310 2310
            } else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) {
2311 2311
                MatroskaAudioTrack *audiotrack = (MatroskaAudioTrack *)track;
2312 2312

  
2313
                st->codec.codec_type = CODEC_TYPE_AUDIO;
2314
                st->codec.sample_rate = audiotrack->samplerate;
2315
                st->codec.channels = audiotrack->channels;
2313
                st->codec->codec_type = CODEC_TYPE_AUDIO;
2314
                st->codec->sample_rate = audiotrack->samplerate;
2315
                st->codec->channels = audiotrack->channels;
2316 2316
            }
2317 2317

  
2318 2318
            /* What do we do with private data? E.g. for Vorbis. */
......
2700 2700
    }
2701 2701

  
2702 2702
    for (n = 0; n < s->nb_streams; n++) {
2703
        av_free(s->streams[n]->codec.extradata);
2703
        av_free(s->streams[n]->codec->extradata);
2704 2704
    }
2705 2705

  
2706 2706
    memset(matroska, 0, sizeof(MatroskaDemuxContext));

Also available in: Unified diff