History

Revert "fbdev: simplify logic in fbdev_read_packet()"

This change is buggy. This reverts commit d46c9f83cf495c901e6128ce1042190f620b89c4.

Michael Niedermayer committed 15 years ago

Commit 2e92a341 parent 53818231 file · +10 −8Browse files

Unified · Split

libavdevice/fbdev.c+10−8
@@ -189,20 +189,22 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt) · 188 unmodified lines
189189 fbdev->time_frame = av_gettime();
190190
191191 /* wait based on the frame rate */
192− curtime = av_gettime();
193− delay = fbdev->time_frame - curtime;
194− av_dlog(avctx,
195− "time_frame:%"PRId64" curtime:%"PRId64" delay:%"PRId64"\n",
196− fbdev->time_frame, curtime, delay);
197− if (delay > 0) {
192+ while (1) {
193+ curtime = av_gettime();
194+ delay = fbdev->time_frame - curtime;
195+ av_dlog(avctx,
196+ "time_frame:%"PRId64" curtime:%"PRId64" delay:%"PRId64"\n",
197+ fbdev->time_frame, curtime, delay);
198+ if (delay <= 0) {
199+ fbdev->time_frame += INT64_C(1000000) * av_q2d(fbdev->time_base);
200+ break;
201+ }
198202 if (avctx->flags & AVFMT_FLAG_NONBLOCK)
199203 return AVERROR(EAGAIN);
200204 ts.tv_sec = delay / 1000000;
201205 ts.tv_nsec = (delay % 1000000) * 1000;
202206 while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
203207 }
204− /* compute the time of the next frame */
205− fbdev->time_frame += INT64_C(1000000) * av_q2d(fbdev->time_base);
206208
207209 if ((ret = av_new_packet(pkt, fbdev->frame_size)) < 0)
208210 return ret;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t