[vlc-commits] videotoolbox: move pic_pacer init/clean
Thomas Guillem
git at videolan.org
Fri Jan 10 13:02:02 CET 2020
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jan 9 14:02:56 2020 +0100| [91b807d10396e07b04bf203e0c72967bef17b6e6] | committer: Thomas Guillem
videotoolbox: move pic_pacer init/clean
No functional changes.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=91b807d10396e07b04bf203e0c72967bef17b6e6
---
modules/codec/videotoolbox.m | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 1c1c345b8a..a34a82af10 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1317,6 +1317,21 @@ static void StopVideoToolbox(decoder_t *p_dec, bool closing)
#pragma mark - module open and close
+static void pic_pacer_Clean(struct pic_pacer *pic_pacer)
+{
+ vlc_mutex_destroy(&pic_pacer->lock);
+ vlc_cond_destroy(&pic_pacer->wait);
+ free(pic_pacer);
+}
+
+static void pic_pacer_Init(struct pic_pacer *pic_pacer, uint8_t pic_reorder_max)
+{
+ vlc_mutex_init(&pic_pacer->lock);
+ vlc_cond_init(&pic_pacer->wait);
+ pic_pacer->nb_field_out = 0;
+ pic_pacer->closed = false;
+ pic_pacer->field_reorder_max = pic_reorder_max * 2;
+}
static int OpenDecoder(vlc_object_t *p_this)
{
@@ -1373,11 +1388,7 @@ static int OpenDecoder(vlc_object_t *p_this)
return VLC_ENOMEM;
}
- vlc_mutex_init(&p_sys->pic_pacer->lock);
- vlc_cond_init(&p_sys->pic_pacer->wait);
- p_sys->pic_pacer->nb_field_out = 0;
- p_sys->pic_pacer->closed = false;
- p_sys->pic_pacer->field_reorder_max = p_sys->i_pic_reorder_max * 2;
+ pic_pacer_Init(&p_sys->pic_pacer, p_sys->i_pic_reorder_max);
p_sys->b_vt_need_keyframe = false;
vlc_mutex_init(&p_sys->lock);
@@ -1447,13 +1458,6 @@ static int OpenDecoder(vlc_object_t *p_this)
return i_ret;
}
-static void pic_pacer_Clean(struct pic_pacer *pic_pacer)
-{
- vlc_mutex_destroy(&pic_pacer->lock);
- vlc_cond_destroy(&pic_pacer->wait);
- free(pic_pacer);
-}
-
static void CloseDecoder(vlc_object_t *p_this)
{
decoder_t *p_dec = (decoder_t *)p_this;
More information about the vlc-commits
mailing list