Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Aug 2000 07:05:48 +0200 (CEST)
From:      Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/20956: Two better patches for the mplex port
Message-ID:  <200008310505.e7V55mq25824@curry.mchp.siemens.de>

next in thread | raw e-mail | index | archive | help

>Number:         20956
>Category:       ports
>Synopsis:       Two better patches for the mplex port
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 30 23:20:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Andre Albsmeier
>Release:        FreeBSD 4.1-STABLE i386
>Organization:
>Environment:

Systems using the mplex port.

>Description:

By default, mplex needs parameter input from the user. This behaviour
has been changed by patch-ac and patch-ad to use defaults. Probably this
has been done to make it possible to use mplex in batch files without
the need for user intervention, e.g. fxtv.

However, in some cases it may be desired to change these parameters. The
two patches below replace patch-ac and patch-ad. They add an -i option
which will enable the user inputs again. If -i is not specified, the
behaviour remains the same so the change should be 100% compatible to 
existing software which rely on mplex as it is now.

>How-To-Repeat:

Use mplex and try to change parameters.

>Fix:

patch-ac only adds the -DTIMER compiletime options which enables
some timing measurements:

--------------------------- snip ----------------------------

--- Makefile.ORI	Wed Aug 30 21:03:47 2000
+++ Makefile	Wed Aug 30 21:05:55 2000
@@ -24,6 +24,8 @@
 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
 
 SRCS = main.c bitstrm.c buffer.c inits.c inptstrm.c interact.c multplex.c systems.c timecode.c


--------------------------- snap ----------------------------


patch-ad now implements the -i option mentioned above:

--------------------------- snip ----------------------------

--- main.c.ORI	Wed Aug 30 20:37:31 2000
+++ main.c	Wed Aug 30 20:36:38 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,
--- inptstrm.c.ORI	Wed May 31 15:04:11 1995
+++ inptstrm.c	Wed Aug 30 20:39:29 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( Interactive )
     ask_continue ();
 }
 
@@ -565,6 +567,7 @@
     close_bit_stream_r (&audio_bs);
     fclose (info_file);
     output_info_audio (audio_info);
+  if( Interactive )
     ask_continue ();
 
 }
--- multplex.c.ORI	Tue Jun  6 14:16:52 1995
+++ multplex.c	Wed Aug 30 20:47:35 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;
     }
 
+if( Interactive ) {
 printf("\nMerging elementary streams to MPEG/SYSTEMS multiplexed stream.\n");
 printf("\n+------------------ MPEG/SYSTEMS INFORMATION -----------------+\n");
     
@@ -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 {
+    sector_size=2324;
+    packets_per_pack=1;
+    video_buffer_size=46;
+    audio_buffer_size=4;
+}
 
     write_pack = packets_per_pack;
     video_buffer_size *= 1024;
@@ -197,6 +205,7 @@
 		 (double)(packets_per_pack-1.))) / (double)(packets_per_pack) );
     data_rate = ceil(dmux_rate/50.)*50;
 
+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 +215,21 @@
     scanf  ("%u", &video_delay_ms);
     printf ("audio stream startup offset (ms)         : ");
     scanf  ("%u", &audio_delay_ms);
+} else {
+    dmux_rate=data_rate;
+    sectors_delay=8;
+    video_delay_ms=0;
+    audio_delay_ms=0;
+}
 
     video_delay = (double)video_delay_ms*(double)(CLOCKS/1000);
     audio_delay = (double)audio_delay_ms*(double)(CLOCKS/1000);
 
+if( Interactive ) {
     verbose=ask_verbose();
     printf ("\n");
+} else
+    verbose=1;
 
 #ifdef TIMER
     gettimeofday (&tp_global_start,NULL);

--------------------------- snap ----------------------------

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008310505.e7V55mq25824>