[FFmpeg-devel] [PATCH] Incorrect Ogg Theora duration
Måns Rullgård
mans
Thu Jun 26 15:17:48 CEST 2008
Michael Niedermayer wrote:
> I am also for riping the start_time calculation out,
> mans? are you ok with removing the start_time guessing code?
> The values it guesses are wrong and do not match the timestamp of the
> first packet. And they happen to mess up stream copy as ffmpeg subtracts
> the smallest start_time which leads to many packets with negative timestamps.
>
> ill apply below in a few days if i hear no objections:
>
> ogg->size = size;
> ogg_restore (s, 0);
> - ogg_save (s);
> - while (!ogg_read_page (s, &i)) {
> - if (i == idx && ogg->streams[i].granule != -1 &&
ogg->streams[i].granule != 0)
> - break;
> - }
> - if (i == idx) {
> - s->streams[idx]->start_time = ogg_gptopts (s, idx,
ogg->streams[idx].granule);
> - s->streams[idx]->duration -= s->streams[idx]->start_time;
> - }
> - ogg_restore (s, 0);
>
> return 0;
OK
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list