[vlc-commits] es_out: really update fmt on ES_OUT_SET_ES_FMT
Francois Cartegnie
git at videolan.org
Sat Jul 4 15:50:46 CEST 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jun 16 18:21:15 2015 +0200| [7893997767521a5d2e11704664300260b6efeb40] | committer: Francois Cartegnie
es_out: really update fmt on ES_OUT_SET_ES_FMT
We want to update format and decoder without having to
es_out_Add/es_out_Del which would alter id and selected state.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7893997767521a5d2e11704664300260b6efeb40
---
src/input/es_out.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/src/input/es_out.c b/src/input/es_out.c
index af905df..0ee3913 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -2407,25 +2407,13 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
if( es == NULL )
return VLC_EGENERIC;
- if( p_fmt->i_extra )
- {
- es->fmt.i_extra = p_fmt->i_extra;
- es->fmt.p_extra = xrealloc( es->fmt.p_extra, p_fmt->i_extra );
- memcpy( es->fmt.p_extra, p_fmt->p_extra, p_fmt->i_extra );
+ es_format_Clean( &es->fmt );
+ es_format_Copy( &es->fmt, p_fmt );
- if( !es->p_dec )
- return VLC_SUCCESS;
-#if 1
+ if( es->p_dec )
+ {
EsDestroyDecoder( out, es );
-
EsCreateDecoder( out, es );
-#else
- es->p_dec->fmt_in.i_extra = p_fmt->i_extra;
- es->p_dec->fmt_in.p_extra =
- xrealloc( es->p_dec->fmt_in.p_extra, p_fmt->i_extra );
- memcpy( es->p_dec->fmt_in.p_extra,
- p_fmt->p_extra, p_fmt->i_extra );
-#endif
}
return VLC_SUCCESS;
More information about the vlc-commits
mailing list