$OpenBSD: patch-main_c,v 1.2 2002/08/12 19:33:31 wcobb Exp $ --- main.c.orig Wed Apr 5 05:51:53 1995 +++ main.c Thu Jul 18 15:49:22 2002 @@ -59,6 +59,7 @@ *************************************************************************/ #include "main.h" +#include /************************************************************************* Main @@ -75,6 +76,8 @@ struct timeval tp_global_end; #endif +int Interactive=0, Verbose=0; + int main (argc, argv) int argc; @@ -93,6 +96,14 @@ char* argv[]; unsigned int which_streams=0; double startup_delay=0; + int fd; + + if( getopt( argc, argv, "i" ) == 'i' ) + Interactive=1; + + optind -= 1; + argc -= optind; + argv += optind; intro (argc); check_files (argc, argv, &audio_file, &video_file, &multi_file, @@ -102,13 +113,35 @@ char* argv[]; empty_audio_struc (&audio_info); if (which_streams & STREAMS_VIDEO) { - video_units=tempnam ("./","tmp_v"); + video_units=strdup ("./XXXXXXXX.tmp_v"); + if (video_units == NULL) { + perror ("strdup (\"./XXXXXXXX.tmp_v\") failed"); + return (1); + } + + fd=mkstemps(video_units, strlen (".tmp_v")); + if (fd == -1) { + perror ("mkstemps() failed"); + return (1); + } + close(fd); get_info_video (video_file, video_units, &video_info, &startup_delay, video_bytes); } if (which_streams & STREAMS_AUDIO) { - audio_units=tempnam ("./","tmp_a"); + audio_units=strdup ("./XXXXXXXX.tmp_a"); + if (audio_units == NULL) { + perror ("strdup (\"./XXXXXXXX.tmp_a\") failed"); + return (1); + } + + fd=mkstemps(audio_units, strlen (".tmp_a")); + if (fd == -1) { + perror ("mkstemps() failed"); + return (1); + } + close(fd); get_info_audio (audio_file, audio_units, &audio_info, &startup_delay, audio_bytes); }