if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size ||
(avctx->active_thread_type & FF_THREAD_FRAME)) {
+#if FF_API_MERGE_SD
+FF_DISABLE_DEPRECATION_WARNINGS
int did_split = av_packet_split_side_data(&tmp);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
ret = apply_param_change(avctx, &tmp);
if (ret < 0)
goto fail;
emms_c(); //needed to avoid an emms_c() call before every return;
avctx->internal->pkt = NULL;
+#if FF_API_MERGE_SD
if (did_split) {
av_packet_free_side_data(&tmp);
if(ret == tmp.size)
ret = avpkt->size;
}
+#endif
if (picture->flags & AV_FRAME_FLAG_DISCARD) {
*got_picture_ptr = 0;
}
uint8_t discard_reason = 0;
// copy to ensure we do not change avpkt
AVPacket tmp = *avpkt;
+#if FF_API_MERGE_SD
+FF_DISABLE_DEPRECATION_WARNINGS
int did_split = av_packet_split_side_data(&tmp);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
ret = apply_param_change(avctx, &tmp);
if (ret < 0)
goto fail;
}
fail:
avctx->internal->pkt = NULL;
+#if FF_API_MERGE_SD
if (did_split) {
av_packet_free_side_data(&tmp);
if(ret == tmp.size)
ret = avpkt->size;
}
+#endif
if (ret >= 0 && *got_frame_ptr) {
if (!avctx->refcounted_frames) {
if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size) {
AVPacket pkt_recoded;
AVPacket tmp = *avpkt;
+#if FF_API_MERGE_SD
+FF_DISABLE_DEPRECATION_WARNINGS
int did_split = av_packet_split_side_data(&tmp);
//apply_param_change(avctx, &tmp);
memset(tmp.data + tmp.size, 0,
FFMIN(avpkt->size - tmp.size, AV_INPUT_BUFFER_PADDING_SIZE));
}
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
pkt_recoded = tmp;
ret = recode_subtitle(avctx, &pkt_recoded, &tmp);
avctx->internal->pkt = NULL;
}
+#if FF_API_MERGE_SD
if (did_split) {
av_packet_free_side_data(&tmp);
if(ret == tmp.size)
ret = avpkt->size;
}
+#endif
if (*got_sub_ptr)
avctx->frame_number++;
if (avctx->codec->send_packet) {
if (avpkt) {
AVPacket tmp = *avpkt;
+#if FF_API_MERGE_SD
+FF_DISABLE_DEPRECATION_WARNINGS
int did_split = av_packet_split_side_data(&tmp);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
ret = apply_param_change(avctx, &tmp);
if (ret >= 0)
ret = avctx->codec->send_packet(avctx, &tmp);
+#if FF_API_MERGE_SD
if (did_split)
av_packet_free_side_data(&tmp);
+#endif
return ret;
} else {
return avctx->codec->send_packet(avctx, NULL);