Skip to content

Commit

Permalink
upipe_ts_mux: warn when input has no octetrate
Browse files Browse the repository at this point in the history
  • Loading branch information
quarium authored and cmassiot committed Jul 22, 2024
1 parent fb51c14 commit 9c13e59
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/upipe-ts/upipe_ts_mux.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2013-2019 OpenHeadend S.A.R.L.
* Copyright (C) 2020-2023 EasyTools S.A.S.
* Copyright (C) 2020-2024 EasyTools S.A.S.
*
* Authors: Christophe Massiot
*
Expand Down Expand Up @@ -1111,25 +1111,21 @@ static int upipe_ts_mux_input_set_flow_def(struct upipe *upipe,
struct upipe_ts_mux *upipe_ts_mux = upipe_ts_mux_from_program_mgr(
upipe_ts_mux_program_to_upipe(program)->mgr);
const char *def;
uint64_t octetrate;
uint64_t octetrate = 0;

UBASE_RETURN(uref_flow_get_def(flow_def, &def))

/* check virtual/block and octetrate */
const char *sub_def = def;
if (!ubase_ncmp(sub_def, "void.")) {
sub_def += strlen("void");

octetrate = 0;
}
else if (!ubase_ncmp(sub_def, "block.")) {
sub_def += strlen("block");

if (!ubase_check(
uref_block_flow_get_octetrate(flow_def, &octetrate)) ||
!octetrate) {
UBASE_RETURN(uref_block_flow_get_max_octetrate(
flow_def, &octetrate));
uref_block_flow_get_octetrate(flow_def, &octetrate);
if (!octetrate) {
uref_block_flow_get_max_octetrate(flow_def, &octetrate);
if (!octetrate) {
upipe_warn_va(upipe, "no octetrate found");
return UBASE_ERR_INVALID;
Expand Down

0 comments on commit 9c13e59

Please sign in to comment.