assign sequence numbers to unknown streams too

issue #14
This commit is contained in:
Frédéric Mangano 2016-04-08 16:02:40 +02:00
parent d3b4a389bc
commit dd0656cb07
3 changed files with 10 additions and 15 deletions

View File

@ -94,8 +94,7 @@ special id \fBall\fP selects all the Opus streams found, and is the default
value.
.sp
The identifer of a stream is determined from its position in the file. The
first Opus stream found will have id 1, the second 2, and so on. Non-Opus
streams are not numbered.
first stream found will have id 1, the second 2, and so on.
.sp
You can select more than one stream with this option by separated id's with commas. For example: \-\-stream 1,3. Ranges are not supported.
.sp

View File

@ -14,12 +14,10 @@ void opustags::list_tags(ogg::Decoder &dec, ITagsHandler &handler, bool full)
break; // end of stream
switch (s->state) {
case ogg::HEADER_READY:
if (s->type != ogg::UNKNOWN_STREAM) {
stream_count++;
sequence_numbers[s->stream.serialno] = stream_count;
if (!handler.relevant(stream_count))
s->downgrade();
}
stream_count++;
sequence_numbers[s->stream.serialno] = stream_count;
if (!handler.relevant(stream_count))
s->downgrade();
remaining_streams++;
break;
case ogg::TAGS_READY:
@ -50,12 +48,10 @@ void opustags::edit_tags(
switch (s->state) {
case ogg::HEADER_READY:
if (s->type != ogg::UNKNOWN_STREAM) {
stream_count++;
sequence_numbers[s->stream.serialno] = stream_count;
if (!handler.relevant(stream_count))
s->downgrade(); // makes it UNKNOWN
}
stream_count++;
sequence_numbers[s->stream.serialno] = stream_count;
if (!handler.relevant(stream_count))
s->downgrade(); // makes it UNKNOWN
if (s->type == ogg::UNKNOWN_STREAM) {
out.write_raw_page(in.current_page);
} else {

View File

@ -105,7 +105,7 @@ TEST_CASE("editing a specific stream", "[actions]")
{
ogg::Decoder dec(in);
ogg::Encoder enc(out);
InsertionTagsHandler editor(2, "pwnd", "yes");
InsertionTagsHandler editor(3, "pwnd", "yes");
edit_tags(dec, enc, editor);
}