From 91c5c6993d2d57342ba07b1b4398f51d050b8aaf Mon Sep 17 00:00:00 2001 From: Daniel Morandini Date: Mon, 6 Nov 2023 18:27:03 +0100 Subject: [PATCH] Use dirty scheduler --- c_src/libav.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/c_src/libav.c b/c_src/libav.c index f1d2d30..f4cc80a 100644 --- a/c_src/libav.c +++ b/c_src/libav.c @@ -455,18 +455,22 @@ static ErlNifFunc nif_funcs[] = { // Demuxer {"demuxer_alloc_from_file", 1, enif_demuxer_alloc_from_file, ERL_NIF_DIRTY_JOB_IO_BOUND}, - {"demuxer_streams", 1, enif_demuxer_streams}, - {"demuxer_read_packet", 1, enif_demuxer_read_packet}, + {"demuxer_streams", 1, enif_demuxer_streams, ERL_NIF_DIRTY_JOB_IO_BOUND}, + {"demuxer_read_packet", 1, enif_demuxer_read_packet, + ERL_NIF_DIRTY_JOB_IO_BOUND}, // // Decoder - {"decoder_alloc", 2, enif_decoder_alloc}, - {"decoder_stream_format", 1, enif_decoder_stream_format}, - {"decoder_add_data", 2, enif_decoder_add_data}, + {"decoder_alloc", 2, enif_decoder_alloc, ERL_NIF_DIRTY_JOB_IO_BOUND}, + {"decoder_stream_format", 1, enif_decoder_stream_format, + ERL_NIF_DIRTY_JOB_IO_BOUND}, + {"decoder_add_data", 2, enif_decoder_add_data, ERL_NIF_DIRTY_JOB_IO_BOUND}, // // General - {"packet_stream_index", 1, enif_packet_stream_index}, + {"packet_stream_index", 1, enif_packet_stream_index, + ERL_NIF_DIRTY_JOB_IO_BOUND}, // // TODO // // Maybe unpack_* would be better function naming. - {"packet_unpack", 1, enif_packet_unpack}, - {"audio_frame_unpack", 1, enif_audio_frame_unpack}, + {"packet_unpack", 1, enif_packet_unpack, ERL_NIF_DIRTY_JOB_IO_BOUND}, + {"audio_frame_unpack", 1, enif_audio_frame_unpack, + ERL_NIF_DIRTY_JOB_IO_BOUND}, }; ERL_NIF_INIT(Elixir.AVx.NIF, nif_funcs, load, NULL, NULL, NULL)