mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
Make user interaction a runtime switch instead of a compiletime option.
PR: 20956 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
This commit is contained in:
parent
378999b03e
commit
18d3e9c571
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=32273
8 changed files with 148 additions and 80 deletions
|
@ -1,6 +1,6 @@
|
|||
--- Makefile.orig Tue Apr 11 16:46:13 1995
|
||||
+++ Makefile Fri Feb 11 09:53:49 2000
|
||||
@@ -19,9 +19,9 @@
|
||||
--- Makefile.orig Tue Apr 11 02:46:13 1995
|
||||
+++ Makefile Mon Sep 4 18:13:42 2000
|
||||
@@ -19,10 +19,12 @@
|
||||
|
||||
#CFLAGS = -g
|
||||
|
||||
|
@ -10,5 +10,8 @@
|
|||
-CC = cc
|
||||
+CC ?= cc
|
||||
RM = /bin/rm -f
|
||||
+
|
||||
+CFLAGS+= -DTIMER
|
||||
|
||||
OBJS = main.o bitstrm.o buffer.o inits.o inptstrm.o interact.o multplex.o systems.o timecode.o
|
||||
|
||||
|
|
|
@ -1,22 +1,24 @@
|
|||
--- inptstrm.c.orig Wed May 31 22:04:11 1995
|
||||
+++ inptstrm.c Fri Feb 11 09:52:17 2000
|
||||
@@ -310,7 +310,9 @@
|
||||
--- inptstrm.c.orig Wed May 31 08:04:11 1995
|
||||
+++ inptstrm.c Mon Sep 4 18:17:45 2000
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "main.h"
|
||||
+extern int Interactive;
|
||||
/*************************************************************************
|
||||
MPEG Streams Kontrolle
|
||||
|
||||
@@ -310,6 +311,7 @@
|
||||
fclose (info_file);
|
||||
output_info_video (video_info);
|
||||
|
||||
+#if 0
|
||||
+ if( Interactive )
|
||||
ask_continue ();
|
||||
+#endif
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
@@ -565,7 +567,9 @@
|
||||
@@ -565,6 +567,7 @@
|
||||
close_bit_stream_r (&audio_bs);
|
||||
fclose (info_file);
|
||||
output_info_audio (audio_info);
|
||||
+#if 0
|
||||
+ if( Interactive )
|
||||
ask_continue ();
|
||||
+#endif
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,64 +1,59 @@
|
|||
--- multplex.c.orig Tue Jun 6 21:16:52 1995
|
||||
+++ multplex.c Fri Feb 11 09:52:17 2000
|
||||
@@ -129,21 +129,28 @@
|
||||
--- multplex.c.orig Tue Jun 6 07:16:52 1995
|
||||
+++ multplex.c Mon Sep 4 18:17:45 2000
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "main.h"
|
||||
+extern int Interactive;
|
||||
#ifdef TIMER
|
||||
extern long total_sec;
|
||||
extern long total_usec;
|
||||
@@ -129,6 +130,7 @@
|
||||
picture_start = TRUE;
|
||||
}
|
||||
|
||||
+#ifdef ASK_FOR_PARAMS
|
||||
+if( Interactive ) {
|
||||
printf("\nMerging elementary streams to MPEG/SYSTEMS multiplexed stream.\n");
|
||||
printf("\n+------------------ MPEG/SYSTEMS INFORMATION -----------------+\n");
|
||||
-
|
||||
+
|
||||
do
|
||||
+
|
||||
{
|
||||
printf ("\nsector size (CD-ROM 2324 bytes) : ");
|
||||
scanf ("%ld", §or_size);
|
||||
} while (sector_size>MAX_SECTOR_SIZE);
|
||||
-
|
||||
printf ("packs to packets ratio 1 : ");
|
||||
scanf ("%ld", &packets_per_pack);
|
||||
printf ("\nSTD video buffer in kB (CSPS: max 46 kB) : ");
|
||||
|
||||
@@ -144,6 +146,12 @@
|
||||
scanf ("%ld", &video_buffer_size);
|
||||
printf ("STD audio buffer in kB (CSPS: max 4 kB) : ");
|
||||
scanf ("%ld", &audio_buffer_size);
|
||||
+#else
|
||||
+} else {
|
||||
+ sector_size=2324;
|
||||
+ packets_per_pack=1;
|
||||
+ video_buffer_size=46;
|
||||
+ audio_buffer_size=4;
|
||||
+#endif
|
||||
+}
|
||||
|
||||
write_pack = packets_per_pack;
|
||||
video_buffer_size *= 1024;
|
||||
@@ -197,6 +204,7 @@
|
||||
@@ -197,6 +205,7 @@
|
||||
(double)(packets_per_pack-1.))) / (double)(packets_per_pack) );
|
||||
data_rate = ceil(dmux_rate/50.)*50;
|
||||
|
||||
+#ifdef ASK_FOR_PARAMS
|
||||
+if( Interactive ) {
|
||||
printf ("\ncomputed multiplexed stream data rate : %7.3f\n",dmux_rate);
|
||||
printf ("target data rate (e.g. %6u) : ",data_rate);
|
||||
scanf ("%lf", &dmux_rate);
|
||||
@@ -206,12 +214,22 @@
|
||||
@@ -206,12 +215,21 @@
|
||||
scanf ("%u", &video_delay_ms);
|
||||
printf ("audio stream startup offset (ms) : ");
|
||||
scanf ("%u", &audio_delay_ms);
|
||||
+#else
|
||||
+} else {
|
||||
+ dmux_rate=data_rate;
|
||||
+ sectors_delay=0;
|
||||
+ sectors_delay=8;
|
||||
+ video_delay_ms=0;
|
||||
+ audio_delay_ms=0;
|
||||
+#endif
|
||||
+}
|
||||
|
||||
video_delay = (double)video_delay_ms*(double)(CLOCKS/1000);
|
||||
audio_delay = (double)audio_delay_ms*(double)(CLOCKS/1000);
|
||||
|
||||
+#ifdef ASK_FOR_PARAMS
|
||||
+if( Interactive ) {
|
||||
verbose=ask_verbose();
|
||||
printf ("\n");
|
||||
+#else
|
||||
+} else
|
||||
+ verbose=1;
|
||||
+#endif
|
||||
|
||||
#ifdef TIMER
|
||||
gettimeofday (&tp_global_start,NULL);
|
||||
|
|
34
graphics/mplex/files/patch-af
Normal file
34
graphics/mplex/files/patch-af
Normal file
|
@ -0,0 +1,34 @@
|
|||
--- main.c.orig Wed Apr 5 03:51:53 1995
|
||||
+++ main.c Mon Sep 4 18:17:45 2000
|
||||
@@ -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 @@
|
||||
unsigned int which_streams=0;
|
||||
double startup_delay=0;
|
||||
|
||||
+ int tmp;
|
||||
+
|
||||
+ 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,
|
|
@ -1,6 +1,6 @@
|
|||
--- Makefile.orig Tue Apr 11 16:46:13 1995
|
||||
+++ Makefile Fri Feb 11 09:53:49 2000
|
||||
@@ -19,9 +19,9 @@
|
||||
--- Makefile.orig Tue Apr 11 02:46:13 1995
|
||||
+++ Makefile Mon Sep 4 18:13:42 2000
|
||||
@@ -19,10 +19,12 @@
|
||||
|
||||
#CFLAGS = -g
|
||||
|
||||
|
@ -10,5 +10,8 @@
|
|||
-CC = cc
|
||||
+CC ?= cc
|
||||
RM = /bin/rm -f
|
||||
+
|
||||
+CFLAGS+= -DTIMER
|
||||
|
||||
OBJS = main.o bitstrm.o buffer.o inits.o inptstrm.o interact.o multplex.o systems.o timecode.o
|
||||
|
||||
|
|
|
@ -1,22 +1,24 @@
|
|||
--- inptstrm.c.orig Wed May 31 22:04:11 1995
|
||||
+++ inptstrm.c Fri Feb 11 09:52:17 2000
|
||||
@@ -310,7 +310,9 @@
|
||||
--- inptstrm.c.orig Wed May 31 08:04:11 1995
|
||||
+++ inptstrm.c Mon Sep 4 18:17:45 2000
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "main.h"
|
||||
+extern int Interactive;
|
||||
/*************************************************************************
|
||||
MPEG Streams Kontrolle
|
||||
|
||||
@@ -310,6 +311,7 @@
|
||||
fclose (info_file);
|
||||
output_info_video (video_info);
|
||||
|
||||
+#if 0
|
||||
+ if( Interactive )
|
||||
ask_continue ();
|
||||
+#endif
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
@@ -565,7 +567,9 @@
|
||||
@@ -565,6 +567,7 @@
|
||||
close_bit_stream_r (&audio_bs);
|
||||
fclose (info_file);
|
||||
output_info_audio (audio_info);
|
||||
+#if 0
|
||||
+ if( Interactive )
|
||||
ask_continue ();
|
||||
+#endif
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,64 +1,59 @@
|
|||
--- multplex.c.orig Tue Jun 6 21:16:52 1995
|
||||
+++ multplex.c Fri Feb 11 09:52:17 2000
|
||||
@@ -129,21 +129,28 @@
|
||||
--- multplex.c.orig Tue Jun 6 07:16:52 1995
|
||||
+++ multplex.c Mon Sep 4 18:17:45 2000
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "main.h"
|
||||
+extern int Interactive;
|
||||
#ifdef TIMER
|
||||
extern long total_sec;
|
||||
extern long total_usec;
|
||||
@@ -129,6 +130,7 @@
|
||||
picture_start = TRUE;
|
||||
}
|
||||
|
||||
+#ifdef ASK_FOR_PARAMS
|
||||
+if( Interactive ) {
|
||||
printf("\nMerging elementary streams to MPEG/SYSTEMS multiplexed stream.\n");
|
||||
printf("\n+------------------ MPEG/SYSTEMS INFORMATION -----------------+\n");
|
||||
-
|
||||
+
|
||||
do
|
||||
+
|
||||
{
|
||||
printf ("\nsector size (CD-ROM 2324 bytes) : ");
|
||||
scanf ("%ld", §or_size);
|
||||
} while (sector_size>MAX_SECTOR_SIZE);
|
||||
-
|
||||
printf ("packs to packets ratio 1 : ");
|
||||
scanf ("%ld", &packets_per_pack);
|
||||
printf ("\nSTD video buffer in kB (CSPS: max 46 kB) : ");
|
||||
|
||||
@@ -144,6 +146,12 @@
|
||||
scanf ("%ld", &video_buffer_size);
|
||||
printf ("STD audio buffer in kB (CSPS: max 4 kB) : ");
|
||||
scanf ("%ld", &audio_buffer_size);
|
||||
+#else
|
||||
+} else {
|
||||
+ sector_size=2324;
|
||||
+ packets_per_pack=1;
|
||||
+ video_buffer_size=46;
|
||||
+ audio_buffer_size=4;
|
||||
+#endif
|
||||
+}
|
||||
|
||||
write_pack = packets_per_pack;
|
||||
video_buffer_size *= 1024;
|
||||
@@ -197,6 +204,7 @@
|
||||
@@ -197,6 +205,7 @@
|
||||
(double)(packets_per_pack-1.))) / (double)(packets_per_pack) );
|
||||
data_rate = ceil(dmux_rate/50.)*50;
|
||||
|
||||
+#ifdef ASK_FOR_PARAMS
|
||||
+if( Interactive ) {
|
||||
printf ("\ncomputed multiplexed stream data rate : %7.3f\n",dmux_rate);
|
||||
printf ("target data rate (e.g. %6u) : ",data_rate);
|
||||
scanf ("%lf", &dmux_rate);
|
||||
@@ -206,12 +214,22 @@
|
||||
@@ -206,12 +215,21 @@
|
||||
scanf ("%u", &video_delay_ms);
|
||||
printf ("audio stream startup offset (ms) : ");
|
||||
scanf ("%u", &audio_delay_ms);
|
||||
+#else
|
||||
+} else {
|
||||
+ dmux_rate=data_rate;
|
||||
+ sectors_delay=0;
|
||||
+ sectors_delay=8;
|
||||
+ video_delay_ms=0;
|
||||
+ audio_delay_ms=0;
|
||||
+#endif
|
||||
+}
|
||||
|
||||
video_delay = (double)video_delay_ms*(double)(CLOCKS/1000);
|
||||
audio_delay = (double)audio_delay_ms*(double)(CLOCKS/1000);
|
||||
|
||||
+#ifdef ASK_FOR_PARAMS
|
||||
+if( Interactive ) {
|
||||
verbose=ask_verbose();
|
||||
printf ("\n");
|
||||
+#else
|
||||
+} else
|
||||
+ verbose=1;
|
||||
+#endif
|
||||
|
||||
#ifdef TIMER
|
||||
gettimeofday (&tp_global_start,NULL);
|
||||
|
|
34
multimedia/mplex/files/patch-af
Normal file
34
multimedia/mplex/files/patch-af
Normal file
|
@ -0,0 +1,34 @@
|
|||
--- main.c.orig Wed Apr 5 03:51:53 1995
|
||||
+++ main.c Mon Sep 4 18:17:45 2000
|
||||
@@ -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 @@
|
||||
unsigned int which_streams=0;
|
||||
double startup_delay=0;
|
||||
|
||||
+ int tmp;
|
||||
+
|
||||
+ 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,
|
Loading…
Add table
Reference in a new issue