Its use has been discouraged since 2016, but now is no longer used in avformat, so there is no reason to keep it public.
Showing the changes to libavcodec/avcodec.c (1 of 6 files). Show all
Unified · Split
| @@ -377,7 +377,7 @@ end: · 376 unmodified lines | ||
| 377 | 377 | |
| 378 | 378 | return ret; |
| 379 | 379 | free_and_end: |
| 380 | − avcodec_close(avctx); | |
| 380 | + ff_codec_close(avctx); | |
| 381 | 381 | goto end; |
| 382 | 382 | } |
| 383 | 383 | |
| @@ -432,12 +432,12 @@ void avsubtitle_free(AVSubtitle *sub) · 48 unmodified lines | ||
| 432 | 432 | memset(sub, 0, sizeof(*sub)); |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | −av_cold int avcodec_close(AVCodecContext *avctx) | |
| 435 | +av_cold void ff_codec_close(AVCodecContext *avctx) | |
| 436 | 436 | { |
| 437 | 437 | int i; |
| 438 | 438 | |
| 439 | 439 | if (!avctx) |
| 440 | − return 0; | |
| 440 | + return; | |
| 441 | 441 | |
| 442 | 442 | if (avcodec_is_open(avctx)) { |
| 443 | 443 | AVCodecInternal *avci = avctx->internal; |
| @@ -497,9 +497,15 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 53 unmodified lines | ||
| 497 | 497 | |
| 498 | 498 | avctx->codec = NULL; |
| 499 | 499 | avctx->active_thread_type = 0; |
| 500 | +} | |
| 500 | 501 | |
| 502 | +#if FF_API_AVCODEC_CLOSE | |
| 503 | +int avcodec_close(AVCodecContext *avctx) | |
| 504 | +{ | |
| 505 | + ff_codec_close(avctx); | |
| 501 | 506 | return 0; |
| 502 | 507 | } |
| 508 | +#endif | |
| 503 | 509 | |
| 504 | 510 | static const char *unknown_if_null(const char *str) |
| 505 | 511 | { |