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
377377
378378 return ret;
379379 free_and_end:
380− avcodec_close(avctx);
380+ ff_codec_close(avctx);
381381 goto end;
382382 }
383383
@@ -432,12 +432,12 @@ void avsubtitle_free(AVSubtitle *sub) · 48 unmodified lines
432432 memset(sub, 0, sizeof(*sub));
433433 }
434434
435−av_cold int avcodec_close(AVCodecContext *avctx)
435+av_cold void ff_codec_close(AVCodecContext *avctx)
436436 {
437437 int i;
438438
439439 if (!avctx)
440− return 0;
440+ return;
441441
442442 if (avcodec_is_open(avctx)) {
443443 AVCodecInternal *avci = avctx->internal;
@@ -497,9 +497,15 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 53 unmodified lines
497497
498498 avctx->codec = NULL;
499499 avctx->active_thread_type = 0;
500+}
500501
502+#if FF_API_AVCODEC_CLOSE
503+int avcodec_close(AVCodecContext *avctx)
504+{
505+ ff_codec_close(avctx);
501506 return 0;
502507 }
508+#endif
503509
504510 static const char *unknown_if_null(const char *str)
505511 {

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