History

lavc: deprecate avcodec_close()

Its use has been discouraged since 2016, but now is no longer used in avformat, so there is no reason to keep it public.

Anton Khirnov committed 2 years ago

Commit 1cc24d71 parent ca18bb56 files · +21 −7Browse files

Showing the changes to libavcodec/avcodec.c (1 of 6 files). Show all

Unified · Split

libavcodec/avcodec.c+9−3
@@ -377,7 +377,7 @@ end: · 376 unmodified lines
377 377
378 return ret;378 return ret;
379free_and_end:379free_and_end:
380 avcodec_close(avctx);380 ff_codec_close(avctx);
381 goto end;381 goto end;
382}382}
383 383
@@ -432,12 +432,12 @@ void avsubtitle_free(AVSubtitle *sub) · 48 unmodified lines
432 memset(sub, 0, sizeof(*sub));432 memset(sub, 0, sizeof(*sub));
433}433}
434 434
435av_cold int avcodec_close(AVCodecContext *avctx)435av_cold void ff_codec_close(AVCodecContext *avctx)
436{436{
437 int i;437 int i;
438 438
439 if (!avctx)439 if (!avctx)
440 return 0;440 return;
441 441
442 if (avcodec_is_open(avctx)) {442 if (avcodec_is_open(avctx)) {
443 AVCodecInternal *avci = avctx->internal;443 AVCodecInternal *avci = avctx->internal;
@@ -497,9 +497,15 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 53 unmodified lines
497 497
498 avctx->codec = NULL;498 avctx->codec = NULL;
499 avctx->active_thread_type = 0;499 avctx->active_thread_type = 0;
500}
500 501
502#if FF_API_AVCODEC_CLOSE
503int avcodec_close(AVCodecContext *avctx)
504{
505 ff_codec_close(avctx);
501 return 0;506 return 0;
502}507}
508#endif
503 509
504static const char *unknown_if_null(const char *str)510static const char *unknown_if_null(const char *str)
505{511{

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t