@@ -832,7 +832,7 @@ void update_benchmark(const char *fmt, ...);
const char *opt_match_per_type_str(const SpecifierOptList *sol,
char mediatype);
-void *muxer_thread(void *arg);
-void *encoder_thread(void *arg);
+int muxer_thread(void *arg);
+int encoder_thread(void *arg);
#endif /* FFTOOLS_FFMPEG_H */
@@ -124,7 +124,7 @@ static const AVClass dec_class = {
.item_name = dec_item_name,
};
-static void *decoder_thread(void *arg);
+static int decoder_thread(void *arg);
static int dec_alloc(DecoderPriv **pdec, Scheduler *sch, int send_end_ts)
{
@@ -789,7 +789,7 @@ fail:
return AVERROR(ENOMEM);
}
-static void *decoder_thread(void *arg)
+static int decoder_thread(void *arg)
{
DecoderPriv *dp = arg;
DecThreadContext dt;
@@ -884,7 +884,7 @@ static void *decoder_thread(void *arg)
finish:
dec_thread_uninit(&dt);
- return (void*)(intptr_t)ret;
+ return ret;
}
static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
@@ -675,7 +675,7 @@ static int demux_thread_init(DemuxThreadContext *dt)
return 0;
}
-static void *input_thread(void *arg)
+static int input_thread(void *arg)
{
Demuxer *d = arg;
InputFile *f = &d->f;
@@ -780,7 +780,7 @@ static void *input_thread(void *arg)
finish:
demux_thread_uninit(&dt);
- return (void*)(intptr_t)ret;
+ return ret;
}
static void demux_final_stats(Demuxer *d)
@@ -870,7 +870,7 @@ fail:
return AVERROR(ENOMEM);
}
-void *encoder_thread(void *arg)
+int encoder_thread(void *arg)
{
OutputStream *ost = arg;
Encoder *e = ost->enc;
@@ -948,5 +948,5 @@ void *encoder_thread(void *arg)
finish:
enc_thread_uninit(&et);
- return (void*)(intptr_t)ret;
+ return ret;
}
@@ -626,7 +626,7 @@ static int ifilter_has_all_input_formats(FilterGraph *fg)
return 1;
}
-static void *filter_thread(void *arg);
+static int filter_thread(void *arg);
static char *describe_filter_link(FilterGraph *fg, AVFilterInOut *inout, int in)
{
@@ -2735,7 +2735,7 @@ fail:
return AVERROR(ENOMEM);
}
-static void *filter_thread(void *arg)
+static int filter_thread(void *arg)
{
FilterGraphPriv *fgp = arg;
FilterGraph *fg = &fgp->fg;
@@ -2849,7 +2849,7 @@ finish:
fg_thread_uninit(&fgt);
- return (void*)(intptr_t)ret;
+ return ret;
}
void fg_send_command(FilterGraph *fg, double time, const char *target,
@@ -404,7 +404,7 @@ fail:
return AVERROR(ENOMEM);
}
-void *muxer_thread(void *arg)
+int muxer_thread(void *arg)
{
Muxer *mux = arg;
OutputFile *of = &mux->of;
@@ -453,7 +453,7 @@ void *muxer_thread(void *arg)
finish:
mux_thread_uninit(&mt);
- return (void*)(intptr_t)ret;
+ return ret;
}
static int of_streamcopy(OutputFile *of, OutputStream *ost, AVPacket *pkt)
@@ -2226,7 +2226,7 @@ static void *task_wrapper(void *arg)
int ret;
int err = 0;
- ret = (intptr_t)task->func(task->func_arg);
+ ret = task->func(task->func_arg);
if (ret < 0)
av_log(task->func_arg, AV_LOG_ERROR,
"Task finished with error code: %d (%s)\n", ret, av_err2str(ret));
@@ -102,7 +102,7 @@ typedef struct SchedulerNode {
unsigned idx_stream;
} SchedulerNode;
-typedef void* (*SchThreadFunc)(void *arg);
+typedef int (*SchThreadFunc)(void *arg);
#define SCH_DSTREAM(file, stream) \
(SchedulerNode){ .type = SCH_NODE_TYPE_DEMUX, \