avcodec/cbs: Avoid branch
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
f71d0f0559
commit
0d7172a9ff
1 changed files with 2 additions and 4 deletions
|
|
@ -783,15 +783,13 @@ static int cbs_insert_unit(CodedBitstreamFragment *frag,
|
|||
if (position < frag->nb_units)
|
||||
memcpy(units + position + 1, frag->units + position,
|
||||
(frag->nb_units - position) * sizeof(*units));
|
||||
}
|
||||
|
||||
memset(units + position, 0, sizeof(*units));
|
||||
|
||||
if (units != frag->units) {
|
||||
av_free(frag->units);
|
||||
frag->units = units;
|
||||
}
|
||||
|
||||
memset(units + position, 0, sizeof(*units));
|
||||
|
||||
++frag->nb_units;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue