Skip to content

Commit bd903bb

Browse files
author
izogfif
committed
FFprobe is re-initialized on every ffprobe run. Emscripten's ENVIRONMENT variable was set to "WORKER". Node.js-related code should no longer be present in ffmpeg-core.js.
1 parent 8d63b3a commit bd903bb

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

Diff for: build/ffmpeg-wasm.sh

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ CONF_FLAGS=(
3030
-lswscale
3131
-Wno-deprecated-declarations
3232
$LDFLAGS
33+
-sENVIRONMENT=worker
3334
-sWASM_BIGINT # enable big int support
3435
-sUSE_SDL=2 # use emscripten SDL2 lib port
3536
-sMODULARIZE # modularized to use as a library

Diff for: src/fftools/ffprobe.c

+53
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,58 @@ static void ffprobe_cleanup(int ret)
382382
#if HAVE_THREADS
383383
pthread_mutex_destroy(&log_mutex);
384384
#endif
385+
386+
do_bitexact = 0;
387+
do_count_frames = 0;
388+
do_count_packets = 0;
389+
do_read_frames = 0;
390+
do_read_packets = 0;
391+
do_show_chapters = 0;
392+
do_show_error = 0;
393+
do_show_format = 0;
394+
do_show_frames = 0;
395+
do_show_packets = 0;
396+
do_show_programs = 0;
397+
do_show_streams = 0;
398+
do_show_stream_disposition = 0;
399+
do_show_data = 0;
400+
do_show_program_version = 0;
401+
do_show_library_versions = 0;
402+
do_show_pixel_formats = 0;
403+
do_show_pixel_format_flags = 0;
404+
do_show_pixel_format_components = 0;
405+
do_show_log = 0;
406+
do_show_chapter_tags = 0;
407+
do_show_format_tags = 0;
408+
do_show_frame_tags = 0;
409+
do_show_program_tags = 0;
410+
do_show_stream_tags = 0;
411+
do_show_packet_tags = 0;
412+
show_value_unit = 0;
413+
use_value_prefix = 0;
414+
use_byte_value_binary_prefix = 0;
415+
use_value_sexagesimal_format = 0;
416+
show_private_data = 1;
417+
show_optional_fields = SHOW_OPTIONAL_FIELDS_AUTO;
418+
print_format = NULL;
419+
stream_specifier = NULL;
420+
show_data_hash = NULL;
421+
read_intervals = NULL;
422+
read_intervals_nb = 0;
423+
find_stream_info = 1;
424+
input_filename = NULL;
425+
print_input_filename = NULL;
426+
iformat = NULL;
427+
output_filename = NULL;
428+
hash = NULL;
429+
nb_streams = 0;
430+
nb_streams_packets = NULL;
431+
nb_streams_frames = NULL;
432+
selected_streams = NULL;
433+
log_buffer = NULL;
434+
log_buffer_size = 0;
435+
436+
av_log(NULL, AV_LOG_DEBUG, "FFprobe: Cleanup done.\n");
385437
}
386438

387439
struct unit_value {
@@ -4037,6 +4089,7 @@ int ffprobe(int argc, char **argv)
40374089
}
40384090
#endif
40394091
av_log_set_flags(AV_LOG_SKIP_REPEATED);
4092+
ffprobe_cleanup(0);
40404093
register_exit(ffprobe_cleanup);
40414094

40424095
options = real_options;

0 commit comments

Comments
 (0)