comparison mov.c @ 4197:84251a788a67 libavformat

move ffindex set before mov_read_default so it can be used in functions
author bcoudurier
date Sun, 11 Jan 2009 21:04:25 +0000
parents a48a6a414dfe
children 7d2f3f1b68d8
comparison
equal deleted inserted replaced
4196:5fc3729da880 4197:84251a788a67
1335 if (!sc) return AVERROR(ENOMEM); 1335 if (!sc) return AVERROR(ENOMEM);
1336 1336
1337 st->priv_data = sc; 1337 st->priv_data = sc;
1338 st->codec->codec_type = CODEC_TYPE_DATA; 1338 st->codec->codec_type = CODEC_TYPE_DATA;
1339 st->start_time = 0; /* XXX: check */ 1339 st->start_time = 0; /* XXX: check */
1340 sc->ffindex = st->index;
1340 1341
1341 if ((ret = mov_read_default(c, pb, atom)) < 0) 1342 if ((ret = mov_read_default(c, pb, atom)) < 0)
1342 return ret; 1343 return ret;
1343 1344
1344 /* sanity checks */ 1345 /* sanity checks */
1361 1362
1362 if(st->duration != AV_NOPTS_VALUE){ 1363 if(st->duration != AV_NOPTS_VALUE){
1363 assert(st->duration % sc->time_rate == 0); 1364 assert(st->duration % sc->time_rate == 0);
1364 st->duration /= sc->time_rate; 1365 st->duration /= sc->time_rate;
1365 } 1366 }
1366 sc->ffindex = st->index; 1367
1367 mov_build_index(c, st); 1368 mov_build_index(c, st);
1368 1369
1369 if (sc->dref_id-1 < sc->drefs_count && sc->drefs[sc->dref_id-1].path) { 1370 if (sc->dref_id-1 < sc->drefs_count && sc->drefs[sc->dref_id-1].path) {
1370 if (url_fopen(&sc->pb, sc->drefs[sc->dref_id-1].path, URL_RDONLY) < 0) 1371 if (url_fopen(&sc->pb, sc->drefs[sc->dref_id-1].path, URL_RDONLY) < 0)
1371 av_log(c->fc, AV_LOG_ERROR, "stream %d, error opening file %s: %s\n", 1372 av_log(c->fc, AV_LOG_ERROR, "stream %d, error opening file %s: %s\n",