Index: head/multimedia/mplex/Makefile =================================================================== --- head/multimedia/mplex/Makefile (revision 434930) +++ head/multimedia/mplex/Makefile (revision 434931) @@ -1,20 +1,23 @@ # Created by: erich@FreeBSD.org # $FreeBSD$ PORTNAME= mplex PORTVERSION= 1.1 CATEGORIES= multimedia MASTER_SITES= LOCAL/sanpei MAINTAINER= ports@FreeBSD.org COMMENT= Multiplexes MPEG component streams into system layers +LICENSE= GPLv2+ +LICENSE_FILE= ${WRKSRC}/COPYING + CONFLICTS= mjpegtools-* PLIST_FILES= bin/mplex man/man1/mplex.1.gz do-install: ${INSTALL_PROGRAM} ${WRKSRC}/mplex ${STAGEDIR}${PREFIX}/bin ${INSTALL_MAN} ${FILESDIR}/mplex.1 ${STAGEDIR}${PREFIX}/man/man1 .include Index: head/multimedia/mplex/files/patch-Makefile =================================================================== --- head/multimedia/mplex/files/patch-Makefile (revision 434930) +++ head/multimedia/mplex/files/patch-Makefile (revision 434931) @@ -1,17 +1,18 @@ ---- Makefile.orig Tue Apr 11 02:46:13 1995 -+++ Makefile Mon Sep 4 18:13:42 2000 -@@ -19,10 +19,12 @@ +--- Makefile.orig 1995-04-11 07:46:13 UTC ++++ Makefile +@@ -19,11 +19,13 @@ #CFLAGS = -g -CFLAGS = -O +CFLAGS?= -O LDFLAGS= -lm -CC = cc +CC ?= cc RM = /bin/rm -f -+ -+CFLAGS+= -DTIMER ++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 Index: head/multimedia/mplex/files/patch-inptstrm.c =================================================================== --- head/multimedia/mplex/files/patch-inptstrm.c (revision 434930) +++ head/multimedia/mplex/files/patch-inptstrm.c (revision 434931) @@ -1,24 +1,24 @@ ---- inptstrm.c.orig Wed May 31 08:04:11 1995 -+++ inptstrm.c Mon Sep 4 18:17:45 2000 +--- inptstrm.c.orig 1995-05-31 13:04:11 UTC ++++ inptstrm.c @@ -1,4 +1,5 @@ #include "main.h" +extern int Interactive; /************************************************************************* MPEG Streams Kontrolle -@@ -310,6 +311,7 @@ +@@ -310,6 +311,7 @@ unsigned int length; fclose (info_file); output_info_video (video_info); + if( Interactive ) ask_continue (); } -@@ -565,6 +567,7 @@ +@@ -565,6 +567,7 @@ unsigned int length; close_bit_stream_r (&audio_bs); fclose (info_file); output_info_audio (audio_info); + if( Interactive ) ask_continue (); } Index: head/multimedia/mplex/files/patch-interact.c =================================================================== --- head/multimedia/mplex/files/patch-interact.c (revision 434930) +++ head/multimedia/mplex/files/patch-interact.c (revision 434931) @@ -1,20 +1,20 @@ ---- interact.c.orig Wed May 31 20:18:33 1995 -+++ interact.c Fri Feb 11 10:04:07 2000 -@@ -67,7 +67,7 @@ +--- interact.c.orig 1995-05-31 11:18:33 UTC ++++ interact.c +@@ -67,7 +67,7 @@ void ask_continue () char input[20]; printf ("\nContinue processing (y/n) : "); - do gets (input); + do fgets (input, sizeof(input), stdin); while (input[0]!='N'&&input[0]!='n'&&input[0]!='y'&&input[0]!='Y'); if (input[0]=='N' || input[0]=='n') -@@ -92,7 +92,7 @@ +@@ -92,7 +92,7 @@ unsigned char ask_verbose () char input[20]; printf ("\nVery verbose mode (y/n) : "); - do gets (input); + do fgets (input, sizeof(input), stdin); while (input[0]!='N'&&input[0]!='n'&&input[0]!='y'&&input[0]!='Y'); if (input[0]=='N' || input[0]=='n') return (FALSE); else return (TRUE); Index: head/multimedia/mplex/files/patch-main.c =================================================================== --- head/multimedia/mplex/files/patch-main.c (revision 434930) +++ head/multimedia/mplex/files/patch-main.c (revision 434931) @@ -1,34 +1,34 @@ ---- main.c.orig Wed Apr 5 03:51:53 1995 -+++ main.c Mon Sep 4 18:17:45 2000 +--- main.c.orig 1995-04-05 08:51:53 UTC ++++ main.c @@ -59,6 +59,7 @@ *************************************************************************/ #include "main.h" +#include /************************************************************************* Main @@ -75,6 +76,8 @@ struct timeval tp_global_end; #endif +int Interactive=0; + int main (argc, argv) int argc; -@@ -93,6 +96,14 @@ +@@ -93,6 +96,14 @@ char* argv[]; 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, Index: head/multimedia/mplex/files/patch-multplex.c =================================================================== --- head/multimedia/mplex/files/patch-multplex.c (revision 434930) +++ head/multimedia/mplex/files/patch-multplex.c (revision 434931) @@ -1,59 +1,59 @@ ---- multplex.c.orig Tue Jun 6 07:16:52 1995 -+++ multplex.c Mon Sep 4 18:17:45 2000 +--- multplex.c.orig 1995-06-06 12:16:52 UTC ++++ multplex.c @@ -1,4 +1,5 @@ #include "main.h" +extern int Interactive; #ifdef TIMER extern long total_sec; extern long total_usec; -@@ -129,6 +130,7 @@ +@@ -129,6 +130,7 @@ unsigned int which_streams; 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 @@ +@@ -144,6 +146,12 @@ printf("\n+------------------ MPEG/SYSTE 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 @@ +@@ -197,6 +205,7 @@ printf("\n+------------------ MPEG/SYSTE (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 @@ +@@ -206,12 +215,21 @@ printf("\n+------------------ MPEG/SYSTE 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);