isolate the process function to the cli module

Its interface is not good enough to be exposed.
This commit is contained in:
Frédéric Mangano-Tarumi 2018-12-02 10:10:40 -05:00
parent 614bd6379b
commit 5860902084
3 changed files with 10 additions and 14 deletions

View File

@ -191,7 +191,13 @@ static ot::status process_tags(const ogg_packet& packet, const ot::options& opt,
}
}
ot::status ot::process(ogg_reader& reader, ogg_writer* writer, const ot::options &opt)
/**
* Main loop of opustags. Read the packets from the reader, and forwards them to the writer.
* Transform the OpusTags packet on the fly.
*
* The writer is optional. When writer is nullptr, opustags runs in read-only mode.
*/
static ot::status process(ot::ogg_reader& reader, ot::ogg_writer* writer, const ot::options &opt)
{
int packet_count = 0;
for (;;) {

View File

@ -8,7 +8,7 @@
#include <opustags.h>
/**
* Main entry point to the opustags binary.
* Main function of the opustags binary.
*
* Does practically nothing but call the cli module.
*/

View File

@ -446,18 +446,8 @@ void print_comments(const std::list<std::string>& comments, FILE* output);
std::list<std::string> read_comments(FILE* input);
/**
* Main loop of opustags. Read the packets from the reader, and forwards them to the writer.
* Transform the OpusTags packet on the fly.
*
* The writer is optional. When writer is nullptr, opustags runs in read-only mode.
*/
status process(ogg_reader& reader, ogg_writer* writer, const options &opt);
/**
* Open the input and output streams, then call #ot::process.
*
* This is the main entry point to the opustags program, and pretty much the same as calling
* opustags from the command-line.
* Main entry point to the opustags program, and pretty much the same as calling opustags from the
* command-line.
*/
status run(const options& opt);