Skip to content
Snippets Groups Projects
Commit abaa3489 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Adds -random_fec option to randomly add FEC to some frames.

Undocumented for now
parent 917cd6e6
No related branches found
No related tags found
No related merge requests found
......@@ -142,6 +142,7 @@ int main(int argc, char *argv[])
int sweep_bps = 0;
int random_framesize=0, newsize=0, delayed_celt=0;
int sweep_max=0, sweep_min=0;
int random_fec=0;
if (argc < 5 )
{
......@@ -297,6 +298,10 @@ int main(int argc, char *argv[])
check_encoder_option(decode_only, "-sweep_max");
sweep_max = atoi( argv[ args + 1 ] );
args += 2;
} else if( STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-random_fec" ) == 0 ) {
check_encoder_option(decode_only, "-random_fec");
random_fec = 1;
args++;
} else {
printf( "Error: unrecognized setting: %s\n\n", argv[ args ] );
print_usage( argv );
......@@ -431,6 +436,10 @@ int main(int argc, char *argv[])
frame_size = newsize;
}
}
if (random_fec && rand()%30==0)
{
opus_encoder_ctl(enc, OPUS_SET_INBAND_FEC(rand()%4==0));
}
if (decode_only)
{
unsigned char ch[4];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment