#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
+
+#include "libavutil/time.h"
#include "libavformat/avformat.h"
static int usage(const char *argv0, int ret)
stream_pos += n;
if (bps) {
avio_flush(output);
- while ((av_gettime() - start_time)*bps/AV_TIME_BASE < stream_pos)
- usleep(50*1000);
+ while ((av_gettime() - start_time) * bps / AV_TIME_BASE < stream_pos)
+ av_usleep(50 * 1000);
}
}
avio_flush(output);
avio_close(output);
+
fail:
avio_close(input);
avformat_network_deinit();