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
189 fbdev->time_frame = av_gettime();189 fbdev->time_frame = av_gettime();
190 190
191 /* wait based on the frame rate */191 /* wait based on the frame rate */
192 curtime = av_gettime();192 while (1) {
193 delay = fbdev->time_frame - curtime;193 curtime = av_gettime();
194 av_dlog(avctx,194 delay = fbdev->time_frame - curtime;
195 "time_frame:%"PRId64" curtime:%"PRId64" delay:%"PRId64"\n",195 av_dlog(avctx,
196 fbdev->time_frame, curtime, delay);196 "time_frame:%"PRId64" curtime:%"PRId64" delay:%"PRId64"\n",
197 if (delay > 0) {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 }
198 if (avctx->flags & AVFMT_FLAG_NONBLOCK)202 if (avctx->flags & AVFMT_FLAG_NONBLOCK)
199 return AVERROR(EAGAIN);203 return AVERROR(EAGAIN);
200 ts.tv_sec = delay / 1000000;204 ts.tv_sec = delay / 1000000;
201 ts.tv_nsec = (delay % 1000000) * 1000;205 ts.tv_nsec = (delay % 1000000) * 1000;
202 while (nanosleep(&ts, &ts) < 0 && errno == EINTR);206 while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
203 }207 }
204 /* compute the time of the next frame */
205 fbdev->time_frame += INT64_C(1000000) * av_q2d(fbdev->time_base);
206 208
207 if ((ret = av_new_packet(pkt, fbdev->frame_size)) < 0)209 if ((ret = av_new_packet(pkt, fbdev->frame_size)) < 0)
208 return ret;210 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