Commit b2122309 authored by stefano's avatar stefano

Make the input realtime framerate emulation code use ist->pts for

computing the time of the next frame to send to output.

See the thread: fix ffmpeg -re behaviour.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15944 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent b4020e1e
...@@ -1306,7 +1306,7 @@ static int output_packet(AVInputStream *ist, int ist_index, ...@@ -1306,7 +1306,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
/* frame rate emulation */ /* frame rate emulation */
if (ist->st->codec->rate_emu) { if (ist->st->codec->rate_emu) {
int64_t pts = av_rescale((int64_t) ist->frame * ist->st->codec->time_base.num, 1000000, ist->st->codec->time_base.den); int64_t pts = av_rescale(ist->pts, 1000000, AV_TIME_BASE);
int64_t now = av_gettime() - ist->start; int64_t now = av_gettime() - ist->start;
if (pts > now) if (pts > now)
usleep(pts - now); usleep(pts - now);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment