[vlc-commits] es_out: terminate free vout in more places
Thomas Guillem
git at videolan.org
Fri May 10 09:51:28 CEST 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu May 9 11:42:39 2019 +0200| [a8816a7b33336d03c26fe65c747098615330cd4b] | committer: Thomas Guillem
es_out: terminate free vout in more places
It was only called from ES_OUT_SET_*_BY_ID controls. The new player is calling
ES_OUT_SET_* directly that was not called TerminateVout.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a8816a7b33336d03c26fe65c747098615330cd4b
---
src/input/es_out.c | 20 +++++++++++++-------
src/input/input.c | 1 -
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/src/input/es_out.c b/src/input/es_out.c
index a344754e0a..c527086bf3 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -744,7 +744,15 @@ static void EsOutChangePosition( es_out_t *out, bool b_flush )
p_sys->i_prev_stream_level = -1;
}
+static void EsOutStopFreeVout( es_out_t *out )
+{
+ es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
+ /* Clean up vout after user action (in active mode only).
+ * FIXME it does not work well with multiple video windows */
+ if( p_sys->b_active )
+ input_resource_TerminateVout( input_priv(p_sys->p_input)->p_resource );
+}
static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
{
@@ -814,8 +822,7 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
(int)MS_FROM_VLC_TICK(vlc_tick_now() - i_decoder_buffering_start) );
/* Here is a good place to destroy unused vout with every demuxer */
- input_resource_TerminateVout( input_priv(p_sys->p_input)->p_resource );
-
+ EsOutStopFreeVout( out );
/* */
const vlc_tick_t i_wakeup_delay = VLC_TICK_FROM_MS(10); /* FIXME CLEANUP thread wake up time*/
@@ -2510,7 +2517,7 @@ static int EsOutVaControlLocked( es_out_t *out, int i_query, va_list args )
}
if (!found)
- input_resource_TerminateVout( input_priv(p_sys->p_input)->p_resource );
+ EsOutStopFreeVout( out );
}
p_sys->b_active = i_mode != ES_OUT_MODE_NONE;
p_sys->i_mode = i_mode;
@@ -2591,6 +2598,7 @@ static int EsOutVaControlLocked( es_out_t *out, int i_query, va_list args )
}
}
+ EsOutStopFreeVout( out );
return VLC_SUCCESS;
}
case ES_OUT_UNSET_ES:
@@ -2605,6 +2613,7 @@ static int EsOutVaControlLocked( es_out_t *out, int i_query, va_list args )
if (EsIsSelected(other))
{
EsOutUnselectEs(out, other, other->p_pgrm == p_sys->p_pgrm);
+ EsOutStopFreeVout( out );
return VLC_SUCCESS;
}
break;
@@ -2653,6 +2662,7 @@ static int EsOutVaControlLocked( es_out_t *out, int i_query, va_list args )
}
}
free(selected_es);
+ EsOutStopFreeVout( out );
return VLC_SUCCESS;
}
@@ -2931,10 +2941,6 @@ static int EsOutVaControlLocked( es_out_t *out, int i_query, va_list args )
}
int i_ret = EsOutControlLocked( out, i_new_query, p_es );
- /* Clean up vout after user action (in active mode only).
- * FIXME it does not work well with multiple video windows */
- if( p_sys->b_active )
- input_resource_TerminateVout( input_priv(p_sys->p_input)->p_resource );
return i_ret;
}
diff --git a/src/input/input.c b/src/input/input.c
index 506e269ecc..381b85a9fd 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2381,7 +2381,6 @@ static bool Control( input_thread_t *p_input,
ControlInsertDemuxFilter( p_input,
vlc_renderer_item_demux_filter( p_item ) );
}
- input_resource_TerminateVout( p_priv->p_resource );
}
es_out_Control( priv->p_es_out_display, ES_OUT_START_ALL_ES,
context );
More information about the vlc-commits
mailing list