1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-10-06 05:47:18 +02:00

doc/examples/decode_filter_video: use av_usleep

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
Kacper Michajłow
2025-08-11 20:25:43 +02:00
parent 5a768e8dd0
commit 9b94b652db

View File

@@ -27,8 +27,6 @@
* @example decode_filter_video.c
*/
#define _XOPEN_SOURCE 600 /* for usleep */
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -38,6 +36,7 @@
#include <libavfilter/buffersrc.h>
#include <libavutil/mem.h>
#include <libavutil/opt.h>
#include <libavutil/time.h>
const char *filter_descr = "scale=78:24,transpose=cclock";
/* other way:
@@ -195,7 +194,7 @@ static void display_frame(const AVFrame *frame, AVRational time_base)
delay = av_rescale_q(frame->pts - last_pts,
time_base, AV_TIME_BASE_Q);
if (delay > 0 && delay < 1000000)
usleep(delay);
av_usleep(delay);
}
last_pts = frame->pts;
}