*
* Deletes from nal_unit, which must be an SEI NAL unit. If this is the
* last message in nal_unit, also deletes it from access_unit.
+ *
+ * Requires nal_unit to be a unit in access_unit and position to be >= 0
+ * and < the payload count of the SEI nal_unit.
*/
-int ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *access_unit,
- CodedBitstreamUnit *nal_unit,
- int position);
+void ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
+ CodedBitstreamFragment *access_unit,
+ CodedBitstreamUnit *nal_unit,
+ int position);
#endif /* AVCODEC_CBS_H264_H */
return 0;
}
-int ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *au,
- CodedBitstreamUnit *nal,
- int position)
+void ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
+ CodedBitstreamFragment *au,
+ CodedBitstreamUnit *nal,
+ int position)
{
H264RawSEI *sei = nal->content;
if (&au->units[i] == nal)
break;
}
- av_assert0(i < au->nb_units && "NAL unit not in access unit.");
ff_cbs_delete_unit(ctx, au, i);
} else {
sei->payload + position + 1,
(sei->payload_count - position) * sizeof(*sei->payload));
}
-
- return 0;
}
for (j = sei->payload_count - 1; j >= 0; j--) {
if (sei->payload[j].payload_type ==
- H264_SEI_TYPE_FILLER_PAYLOAD) {
- err = ff_cbs_h264_delete_sei_message(ctx->cbc, au,
- &au->units[i], j);
- if (err < 0) {
- av_log(bsf, AV_LOG_ERROR, "Failed to delete "
- "filler SEI message.\n");
- goto fail;
- }
- }
+ H264_SEI_TYPE_FILLER_PAYLOAD)
+ ff_cbs_h264_delete_sei_message(ctx->cbc, au,
+ &au->units[i], j);
}
}
}
if (ctx->display_orientation == REMOVE ||
ctx->display_orientation == INSERT) {
- err = ff_cbs_h264_delete_sei_message(ctx->cbc, au,
- &au->units[i], j);
- if (err < 0) {
- av_log(bsf, AV_LOG_ERROR, "Failed to delete "
- "display orientation SEI message.\n");
- goto fail;
- }
+ ff_cbs_h264_delete_sei_message(ctx->cbc, au,
+ &au->units[i], j);
continue;
}