diff mbox series

[FFmpeg-devel,2/3] avcodec/utils: make codec_parameters_reset() a shared function

Message ID 20200810180615.5222-2-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/3] avcodec/bsf: improve the doxy for av_bsf_flush()
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

James Almer Aug. 10, 2020, 6:06 p.m. UTC
It will be useful in the next commit.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/internal.h |  2 ++
 libavcodec/utils.c    | 10 +++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 0a1c0a17ec..a302cb24eb 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -413,6 +413,8 @@  int ff_int_from_list_or_default(void *ctx, const char * val_name, int val,
 
 void ff_dvdsub_parse_palette(uint32_t *palette, const char *p);
 
+void ff_codec_parameters_reset(AVCodecParameters *par);
+
 #if defined(_WIN32) && CONFIG_SHARED && !defined(BUILDING_avcodec)
 #    define av_export_avcodec __declspec(dllimport)
 #else
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 5a2a90b030..3fda7c51d7 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2031,7 +2031,7 @@  AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx)
     return props;
 }
 
-static void codec_parameters_reset(AVCodecParameters *par)
+void ff_codec_parameters_reset(AVCodecParameters *par)
 {
     av_freep(&par->extradata);
 
@@ -2057,7 +2057,7 @@  AVCodecParameters *avcodec_parameters_alloc(void)
 
     if (!par)
         return NULL;
-    codec_parameters_reset(par);
+    ff_codec_parameters_reset(par);
     return par;
 }
 
@@ -2067,14 +2067,14 @@  void avcodec_parameters_free(AVCodecParameters **ppar)
 
     if (!par)
         return;
-    codec_parameters_reset(par);
+    ff_codec_parameters_reset(par);
 
     av_freep(ppar);
 }
 
 int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
 {
-    codec_parameters_reset(dst);
+    ff_codec_parameters_reset(dst);
     memcpy(dst, src, sizeof(*dst));
 
     dst->extradata      = NULL;
@@ -2093,7 +2093,7 @@  int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src
 int avcodec_parameters_from_context(AVCodecParameters *par,
                                     const AVCodecContext *codec)
 {
-    codec_parameters_reset(par);
+    ff_codec_parameters_reset(par);
 
     par->codec_type = codec->codec_type;
     par->codec_id   = codec->codec_id;