diff options
author | Alex Chronopoulos <[email protected]> | 2020-01-20 11:27:44 +0200 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2020-01-21 00:05:56 +1300 |
commit | 3b6cc572b370aebe678e0fd804d34f53341959a3 (patch) | |
tree | d22105e03705dcfbef69e45d8e35694c7d8f0544 /tools | |
parent | 3ab507569153221a72bb79d40947d1f991303abf (diff) | |
download | cubeb-3b6cc572b370aebe678e0fd804d34f53341959a3.tar.gz cubeb-3b6cc572b370aebe678e0fd804d34f53341959a3.zip |
tool: add an option to destroy a stream
Diffstat (limited to 'tools')
-rw-r--r-- | tools/cubeb-test.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/cubeb-test.cpp b/tools/cubeb-test.cpp index ace9f22..2edd9f4 100644 --- a/tools/cubeb-test.cpp +++ b/tools/cubeb-test.cpp @@ -356,7 +356,8 @@ void print_help() { "c: get max number of channels\n" "p: start a initialized stream\n" "s: stop a started stream\n" - "d: force stream to drain\n" + "d: destroy stream\n" + "e: force stream to drain\n" "f: get stream position (client thread)\n" "i: change device type to input\n" "o: change device type to output\n" @@ -423,6 +424,13 @@ bool choose_action(cubeb_client& cl, operation_data * op, int c) { fprintf(stderr, "stop_stream failed\n"); } } else if (c == 'd') { + bool res = cl.destroy_stream(); + if (res) { + fprintf(stderr, "destroy_stream succeed\n"); + } else { + fprintf(stderr, "destroy_stream failed\n"); + } + } else if (c == 'e') { cl.force_drain(); } else if (c == 'c') { uint32_t channel_count = cl.get_max_channel_count(); |