comparison mov.c @ 5345:4f2be9042fd6 libavformat

warn if stream timescale is not set and set it to 1 to avoid FPE
author bcoudurier
date Thu, 05 Nov 2009 07:11:54 +0000
parents d2db7a53bc0d
children e226b1d6a6ee
comparison
equal deleted inserted replaced
5344:b596cf9ab248 5345:4f2be9042fd6
1570 av_log(c->fc, AV_LOG_ERROR, "stream %d, missing mandatory atoms, broken header\n", 1570 av_log(c->fc, AV_LOG_ERROR, "stream %d, missing mandatory atoms, broken header\n",
1571 st->index); 1571 st->index);
1572 return 0; 1572 return 0;
1573 } 1573 }
1574 1574
1575 if (!sc->time_scale) 1575 if (!sc->time_scale) {
1576 av_log(c->fc, AV_LOG_WARNING, "stream %d, timescale not set\n", st->index);
1576 sc->time_scale = c->time_scale; 1577 sc->time_scale = c->time_scale;
1578 if (!sc->time_scale)
1579 sc->time_scale = 1;
1580 }
1577 1581
1578 av_set_pts_info(st, 64, 1, sc->time_scale); 1582 av_set_pts_info(st, 64, 1, sc->time_scale);
1579 1583
1580 if (st->codec->codec_type == CODEC_TYPE_AUDIO && 1584 if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
1581 !st->codec->frame_size && sc->stts_count == 1) { 1585 !st->codec->frame_size && sc->stts_count == 1) {