@@ -368,11 +368,13 @@ static int do_encode(AVCodecContext *avctx, const AVFrame *frame, int *got_packe
avctx->internal->buffer_pkt_valid = 0;
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
+FF_DISABLE_DEPRECATION_WARNINGS
ret = avcodec_encode_video2(avctx, avctx->internal->buffer_pkt,
frame, got_packet);
} else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
ret = avcodec_encode_audio2(avctx, avctx->internal->buffer_pkt,
frame, got_packet);
+FF_ENABLE_DEPRECATION_WARNINGS
} else {
ret = AVERROR(EINVAL);
}
@@ -86,7 +86,9 @@ static void * attribute_align_arg worker(void *v){
pthread_mutex_unlock(&c->task_fifo_mutex);
frame = task.indata;
+FF_DISABLE_DEPRECATION_WARNINGS
ret = avcodec_encode_video2(avctx, pkt, frame, &got_packet);
+FF_ENABLE_DEPRECATION_WARNINGS
pthread_mutex_lock(&c->buffer_mutex);
av_frame_unref(frame);
pthread_mutex_unlock(&c->buffer_mutex);
Disable deprecation declarations compile warning when we really need to call these deprecated functions. Signed-off-by: Zhao, Gang <gang.zhao.42@gmail.com> --- Changes from v1: Removed unnecessary #if check libavcodec/encode.c | 2 ++ libavcodec/frame_thread_encoder.c | 2 ++ 2 files changed, 4 insertions(+)