summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--multicat.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/multicat.c b/multicat.c
index 50c99eb..de62418 100644
--- a/multicat.c
+++ b/multicat.c
@@ -49,6 +49,7 @@ static bool b_overwrite_ssrc = false;
static in_addr_t i_ssrc = 0;
static bool b_input_udp = false, b_output_udp = false;
static size_t i_asked_payload_size = DEFAULT_PAYLOAD_SIZE;
+static bool b_pad_output = true;
static bool b_die = false;
static uint16_t i_rtp_cc;
@@ -60,7 +61,7 @@ ssize_t (*pf_Write)( const void *p_buf, size_t i_len );
static void usage(void)
{
- msg_Raw( NULL, "Usage: multicat [-i <RT priority>] [-t <ttl>] [-p <PCR PID>] [-s <chunks>] [-n <chunks>] [-d <time>] [-a] [-S <SSRC IP>] [-u] [-U] [-m <payload size>] <input item> <output item>" );
+ msg_Raw( NULL, "Usage: multicat [-i <RT priority>] [-t <ttl>] [-p <PCR PID>] [-s <chunks>] [-n <chunks>] [-d <time>] [-a] [-S <SSRC IP>] [-u] [-U] [-P] [-m <payload size>] <input item> <output item>" );
msg_Raw( NULL, " item format: <file path | device path | FIFO path | network host>" );
msg_Raw( NULL, " host format: [<connect addr>[:<connect port>]][@[<bind addr][:<bind port>]]" );
msg_Raw( NULL, " -p: overwrite or create RTP timestamps using PCR PID (MPEG-2/TS)" );
@@ -71,6 +72,7 @@ static void usage(void)
msg_Raw( NULL, " -S: overwrite or create RTP SSRC" );
msg_Raw( NULL, " -u: source has no RTP header" );
msg_Raw( NULL, " -U: destination has no RTP header" );
+ msg_Raw( NULL, " -P: don't add padding to output" );
msg_Raw( NULL, " -m: size of the payload chunk, excluding optional RTP header (default 1316)" );
exit(EXIT_FAILURE);
}
@@ -279,7 +281,7 @@ int main( int i_argc, char **pp_argv )
size_t i_max_read_size, i_max_write_size;
int c;
- while ( (c = getopt( i_argc, pp_argv, "i:t:p:s:n:d:aS:uUm:h" )) != -1 )
+ while ( (c = getopt( i_argc, pp_argv, "i:t:p:s:n:d:aS:uUPm:h" )) != -1 )
{
switch ( c )
{
@@ -329,6 +331,10 @@ int main( int i_argc, char **pp_argv )
b_output_udp = true;
break;
+ case 'P':
+ b_pad_output = false;
+ break;
+
case 'm':
i_asked_payload_size = strtol( optarg, NULL, 0 );
break;
@@ -444,7 +450,7 @@ int main( int i_argc, char **pp_argv )
}
/* Pad to get the asked payload size */
- while ( i_payload_size + TS_SIZE <= i_asked_payload_size )
+ while ( i_payload_size + TS_SIZE <= i_asked_payload_size && b_pad_output )
{
ts_Pad( &p_payload[i_payload_size] );
i_read_size += TS_SIZE;