openbsd-ports/graphics/mplex/patches/patch-main_c
angelos fae68ec075 Initial import of mplex, based on FreeBSD port.
Multiplex MPEG video/audio streams.
2001-06-19 03:23:26 +00:00

74 lines
1.8 KiB
Plaintext

$OpenBSD: patch-main_c,v 1.1.1.1 2001/06/19 03:23:26 angelos Exp $
--- main.c.orig Wed Apr 5 04:51:53 1995
+++ main.c Sun Jun 10 00:56:44 2001
@@ -59,6 +59,7 @@
*************************************************************************/
#include "main.h"
+#include <unistd.h>
/*************************************************************************
Main
@@ -75,6 +76,8 @@
struct timeval tp_global_end;
#endif
+int Interactive=0;
+
int main (argc, argv)
int argc;
@@ -93,6 +96,14 @@ char* argv[];
unsigned int which_streams=0;
double startup_delay=0;
+ int tmp, 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);
}