diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-11-15 22:35:04 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-11-15 22:35:04 +0400 |
commit | aad4117d780cee87e1be03e4a108b9e601367dc8 (patch) | |
tree | 4602fdd3c0d175cebe2d52df8209bed9f29b7fa7 /src | |
parent | 1b28e0cae55f66f76fdd7fae433c392a039565ff (diff) |
Adds a simple padding test to opus_demo (disabled by default)
Diffstat (limited to 'src')
-rw-r--r-- | src/opus_demo.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/opus_demo.c b/src/opus_demo.c index ea8b7a7e..f2349b23 100644 --- a/src/opus_demo.c +++ b/src/opus_demo.c @@ -727,6 +727,18 @@ int main(int argc, char *argv[]) } } +#if 0 /* This is for testing the padding code, do not enable by default */ + if (len[toggle]<1275) + { + int new_len = len[toggle]+rand()%(max_payload_bytes-len[toggle]); + if ((err = opus_packet_pad(data[toggle], len[toggle], new_len)) != OPUS_OK) + { + fprintf(stderr, "padding failed: %s\n", opus_strerror(err)); + return EXIT_FAILURE; + } + len[toggle] = new_len; + } +#endif if (encode_only) { unsigned char int_field[4]; |