| 583 | } |
| 584 | |
| 585 | static int parse_block_def(struct sbg_parser *p, |
| 586 | struct sbg_script_definition *def) |
| 587 | { |
| 588 | int r, tseq; |
| 589 | |
| 590 | lex_space(p); |
| 591 | if (!lex_line_end(p)) |
| 592 | return AVERROR_INVALIDDATA; |
| 593 | tseq = p->nb_block_tseq; |
| 594 | while (1) { |
| 595 | r = parse_time_sequence(p, 1); |
| 596 | if (r < 0) |
| 597 | return r; |
| 598 | if (!r) |
| 599 | break; |
| 600 | } |
| 601 | if (!lex_char(p, '}')) |
| 602 | return AVERROR_INVALIDDATA; |
| 603 | lex_space(p); |
| 604 | if (!lex_line_end(p)) |
| 605 | return AVERROR_INVALIDDATA; |
| 606 | def->type = 'B'; |
| 607 | def->elements = tseq; |
| 608 | def->nb_elements = p->nb_block_tseq - tseq; |
| 609 | if (!def->nb_elements) |
| 610 | return AVERROR_INVALIDDATA; |
| 611 | return 1; |
| 612 | } |
| 613 | |
| 614 | static int parse_volume(struct sbg_parser *p, int *vol) |
| 615 | { |
no test coverage detected