matroskaenc: Fix type used for chapter timestamps

pull/125/head
Vittorio Giovara 10 years ago
parent dc2d0e06af
commit 9272c965d9
  1. 7
      libavformat/matroskaenc.c

@ -917,11 +917,12 @@ static int mkv_write_chapters(AVFormatContext *s)
for (i = 0; i < s->nb_chapters; i++) { for (i = 0; i < s->nb_chapters; i++) {
ebml_master chapteratom, chapterdisplay; ebml_master chapteratom, chapterdisplay;
AVChapter *c = s->chapters[i]; AVChapter *c = s->chapters[i];
int chapterstart = av_rescale_q(c->start, c->time_base, scale); int64_t chapterstart = av_rescale_q(c->start, c->time_base, scale);
int chapterend = av_rescale_q(c->end, c->time_base, scale); int64_t chapterend = av_rescale_q(c->end, c->time_base, scale);
AVDictionaryEntry *t = NULL; AVDictionaryEntry *t = NULL;
if (chapterstart < 0 || chapterstart > chapterend || chapterend < 0) { if (chapterstart < 0 || chapterstart > chapterend || chapterend < 0) {
av_log(s, AV_LOG_ERROR, "Invalid chapter start (%d) or end (%d).\n", av_log(s, AV_LOG_ERROR,
"Invalid chapter start (%"PRId64") or end (%"PRId64").\n",
chapterstart, chapterend); chapterstart, chapterend);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }

Loading…
Cancel
Save