doc/examples/decode_filter_video: use av_usleep
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
parent
5a768e8dd0
commit
9b94b652db
1 changed files with 2 additions and 3 deletions
|
|
@ -27,8 +27,6 @@
|
||||||
* @example decode_filter_video.c
|
* @example decode_filter_video.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _XOPEN_SOURCE 600 /* for usleep */
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
@ -38,6 +36,7 @@
|
||||||
#include <libavfilter/buffersrc.h>
|
#include <libavfilter/buffersrc.h>
|
||||||
#include <libavutil/mem.h>
|
#include <libavutil/mem.h>
|
||||||
#include <libavutil/opt.h>
|
#include <libavutil/opt.h>
|
||||||
|
#include <libavutil/time.h>
|
||||||
|
|
||||||
const char *filter_descr = "scale=78:24,transpose=cclock";
|
const char *filter_descr = "scale=78:24,transpose=cclock";
|
||||||
/* other way:
|
/* other way:
|
||||||
|
|
@ -195,7 +194,7 @@ static void display_frame(const AVFrame *frame, AVRational time_base)
|
||||||
delay = av_rescale_q(frame->pts - last_pts,
|
delay = av_rescale_q(frame->pts - last_pts,
|
||||||
time_base, AV_TIME_BASE_Q);
|
time_base, AV_TIME_BASE_Q);
|
||||||
if (delay > 0 && delay < 1000000)
|
if (delay > 0 && delay < 1000000)
|
||||||
usleep(delay);
|
av_usleep(delay);
|
||||||
}
|
}
|
||||||
last_pts = frame->pts;
|
last_pts = frame->pts;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue