mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-27 19:02:13 +08:00
cbs: ff_cbs_delete_unit: Replace return value with assert
ff_cbs_delete_unit never fails if the index of the unit to delete is valid, as it is with all current callers of the function. So just assert in ff_cbs_delete_unit that the index is valid and change the return value to void in order to remove the callers' checks for whether ff_cbs_delete_unit failed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
committed by
Mark Thompson
parent
70a4f46e48
commit
730e5be3aa
@@ -737,12 +737,12 @@ int ff_cbs_insert_unit_data(CodedBitstreamContext *ctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_cbs_delete_unit(CodedBitstreamContext *ctx,
|
||||
CodedBitstreamFragment *frag,
|
||||
int position)
|
||||
void ff_cbs_delete_unit(CodedBitstreamContext *ctx,
|
||||
CodedBitstreamFragment *frag,
|
||||
int position)
|
||||
{
|
||||
if (position < 0 || position >= frag->nb_units)
|
||||
return AVERROR(EINVAL);
|
||||
av_assert0(0 <= position && position < frag->nb_units
|
||||
&& "Unit to be deleted not in fragment.");
|
||||
|
||||
cbs_unit_uninit(ctx, &frag->units[position]);
|
||||
|
||||
@@ -752,6 +752,4 @@ int ff_cbs_delete_unit(CodedBitstreamContext *ctx,
|
||||
memmove(frag->units + position,
|
||||
frag->units + position + 1,
|
||||
(frag->nb_units - position) * sizeof(*frag->units));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user