Revision 6c00a9de

View differences:

libavformat/mov.c
1187 1187
                            "size %d, distance %d, keyframe %d\n", st->index, current_sample,
1188 1188
                            current_offset, current_dts, sample_size, distance, keyframe);
1189 1189
                }
1190

  
1190 1191
                current_offset += sample_size;
1191 1192
                assert(sc->stts_data[stts_index].duration % sc->time_rate == 0);
1192 1193
                current_dts += sc->stts_data[stts_index].duration / sc->time_rate;
......
1266 1267
        return ret;
1267 1268

  
1268 1269
    /* sanity checks */
1269
    if(sc->chunk_count && (!sc->stts_count || !sc->stsc_count ||
1270
                           (!sc->sample_size && !sc->sample_count))){
1270
    if (sc->chunk_count && (!sc->stts_count || !sc->stsc_count ||
1271
                            (!sc->sample_size && !sc->sample_count))) {
1271 1272
        av_log(c->fc, AV_LOG_ERROR, "stream %d, missing mandatory atoms, broken header\n",
1272 1273
               st->index);
1273 1274
        return 0;
1274 1275
    }
1275
    if(!sc->time_rate)
1276
        sc->time_rate=1;
1277
    if(!sc->time_scale)
1278
        sc->time_scale= c->time_scale;
1276

  
1277
    if (!sc->time_rate)
1278
        sc->time_rate = 1;
1279
    if (!sc->time_scale)
1280
        sc->time_scale = c->time_scale;
1281

  
1279 1282
    av_set_pts_info(st, 64, sc->time_rate, sc->time_scale);
1280 1283

  
1281 1284
    if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
......
1285 1288
        dprintf(c->fc, "frame size %d\n", st->codec->frame_size);
1286 1289
    }
1287 1290

  
1288
    if(st->duration != AV_NOPTS_VALUE){
1291
    if (st->duration != AV_NOPTS_VALUE) {
1289 1292
        assert(st->duration % sc->time_rate == 0);
1290 1293
        st->duration /= sc->time_rate;
1291 1294
    }
......
1309 1312
#if CONFIG_MPEG4_DECODER
1310 1313
    case CODEC_ID_MPEG4:
1311 1314
#endif
1312
        st->codec->width= 0; /* let decoder init width/height */
1315
        st->codec->width = 0; /* let decoder init width/height */
1313 1316
        st->codec->height= 0;
1314 1317
        break;
1315 1318
    }
......
1993 1996

  
1994 1997
static int mov_read_close(AVFormatContext *s)
1995 1998
{
1996
    int i, j;
1997 1999
    MOVContext *mov = s->priv_data;
1998
    for(i=0; i<s->nb_streams; i++) {
2000
    int i, j;
2001

  
2002
    for (i = 0; i < s->nb_streams; i++) {
1999 2003
        MOVStreamContext *sc = s->streams[i]->priv_data;
2004

  
2000 2005
        av_freep(&sc->ctts_data);
2001
        for (j=0; j<sc->drefs_count; j++)
2006
        for (j = 0; j < sc->drefs_count; j++)
2002 2007
            av_freep(&sc->drefs[j].path);
2003 2008
        av_freep(&sc->drefs);
2004 2009
        if (sc->pb && sc->pb != s->pb)
2005 2010
            url_fclose(sc->pb);
2006 2011
    }
2007
    if(mov->dv_demux){
2008
        for(i=0; i<mov->dv_fctx->nb_streams; i++){
2012

  
2013
    if (mov->dv_demux) {
2014
        for(i = 0; i < mov->dv_fctx->nb_streams; i++) {
2009 2015
            av_freep(&mov->dv_fctx->streams[i]->codec);
2010 2016
            av_freep(&mov->dv_fctx->streams[i]);
2011 2017
        }
2012 2018
        av_freep(&mov->dv_fctx);
2013 2019
        av_freep(&mov->dv_demux);
2014 2020
    }
2021

  
2015 2022
    av_freep(&mov->trex_data);
2023

  
2016 2024
    return 0;
2017 2025
}
2018 2026

  

Also available in: Unified diff