vlc/vlc-3.0 | branch: master | Thomas Guillem <[email protected]> | Fri Sep 13 11:15:36 2019 +0200| [e38fee84adbddd9857f11471329f8f429e4cb6ac] | committer: Thomas Guillem
videotoolbox: don't reset the vout when closing (cherry picked from commit e29c031ae88ef9c47048bcd426a404734c17b4f0) Signed-off-by: Thomas Guillem <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=e38fee84adbddd9857f11471329f8f429e4cb6ac --- modules/codec/videotoolbox.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m index 12246c18fe..846523ef7c 100644 --- a/modules/codec/videotoolbox.m +++ b/modules/codec/videotoolbox.m @@ -1290,7 +1290,7 @@ static int StartVideoToolbox(decoder_t *p_dec) return VLC_SUCCESS; } -static void StopVideoToolbox(decoder_t *p_dec) +static void StopVideoToolbox(decoder_t *p_dec, bool closing) { decoder_sys_t *p_sys = p_dec->p_sys; @@ -1308,7 +1308,7 @@ static void StopVideoToolbox(decoder_t *p_dec) * will reallocate frames while previous frames are still used by the * vout (and not released). To work-around this issue, we force a vout * change. */ - if (p_dec->fmt_out.i_codec == VLC_CODEC_CVPX_BGRA + if (!closing && p_dec->fmt_out.i_codec == VLC_CODEC_CVPX_BGRA && p_dec->fmt_out.video.i_width * p_dec->fmt_out.video.i_height >= 8000000) { const video_format_t orig = p_dec->fmt_out.video; @@ -1482,7 +1482,7 @@ static void CloseDecoder(vlc_object_t *p_this) decoder_t *p_dec = (decoder_t *)p_this; decoder_sys_t *p_sys = p_dec->p_sys; - StopVideoToolbox(p_dec); + StopVideoToolbox(p_dec, true); if(p_sys->pf_codec_clean) p_sys->pf_codec_clean(p_dec); @@ -1868,7 +1868,7 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block) /* Drain before stopping */ Drain(p_dec, false); - StopVideoToolbox(p_dec); + StopVideoToolbox(p_dec, false); vlc_mutex_lock(&p_sys->lock); } @@ -1903,7 +1903,7 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block) vlc_mutex_unlock(&p_sys->lock); /* Session will be started by Late Start code block */ - StopVideoToolbox(p_dec); + StopVideoToolbox(p_dec, false); vlc_mutex_lock(&p_sys->lock); p_sys->vtsession_status = VTSESSION_STATUS_OK; @@ -1959,7 +1959,7 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block) msg_Dbg(p_dec, "parameters sets changed: draining decoder"); Drain(p_dec, false); msg_Dbg(p_dec, "parameters sets changed: restarting decoder"); - StopVideoToolbox(p_dec); + StopVideoToolbox(p_dec, false); } if(!p_sys->session) _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
