<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>so, for the Flush function, date_Set(&p_sys->pts, VLC_TICK_INVALID); could be moved after avcodec_flush_buffers( p_context ); and locks should not be needed. Right?<br></div><div><br></div><div><br></div><div>On Wed, Oct 2, 2019, at 13:15, Rémi Denis-Courmont wrote:<br></div><blockquote type="cite" id="qt"><div>This does not look right. If Flush really does what it's supposed to do, no other thread should be racing for the PTS.<br></div><div><br></div><div class="qt-gmail_quote"><div>Le 2 octobre 2019 13:05:40 GMT+03:00, "Hugo Beauzée-Luyssen" <hugo@beauzee.fr> a écrit :<br></div><blockquote style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;" class="qt-gmail_quote"><pre class="qt-k9mail"><div><hr> modules/codec/avcodec/video.c | 8 ++++++++<br></div><div> 1 file changed, 8 insertions(+)<br></div><div><br></div><div>diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c<br></div><div>index d69abd7419..911fee2f8b 100644<br></div><div>--- a/modules/codec/avcodec/video.c<br></div><div>+++ b/modules/codec/avcodec/video.c<br></div><div>@@ -702,7 +702,10 @@ static void Flush( decoder_t *p_dec )<br></div><div> decoder_sys_t *p_sys = p_dec->p_sys;<br></div><div> AVCodecContext *p_context = p_sys->p_context;<br></div><div> <br></div><div>+ vlc_mutex_lock(&p_sys->lock);<br></div><div> date_Set(&p_sys->pts, VLC_TICK_INVALID); /* To make sure we recover properly */<br></div><div>+ vlc_mutex_unlock(&p_sys->lock);<br></div><div>+<br></div><div> p_sys->i_late_frames = 0;<br></div><div> p_sys->framedrop = FRAMEDROP_NONE;<br></div><div> cc_Flush( &p_sys->cc );<br></div><div>@@ -759,7 +762,9 @@ static block_t * filter_earlydropped_blocks( decoder_t *p_dec, block_t *block )<br></div><div> "dropping frame (computer too slow ?)",<br></div><div> p_sys->p_context->reordered_opaque - p_sys->i_last_output_frame );<br></div><div> <br></div><div>+ vlc_mutex_lock(&p_sys->lock);<br></div><div> date_Set( &p_sys->pts, VLC_TICK_INVALID ); /* To make sure we recover properly */<br></div><div>+ vlc_mutex_unlock(&p_sys->lock);<br></div><div> block_Release( block );<br></div><div> p_sys->i_late_frames--;<br></div><div> return NULL;<br></div><div>@@ -1339,7 +1344,10 @@ static int DecodeVideo( decoder_t *p_dec, block_t *p_block )<br></div><div> p_sys->i_last_output_frame = -1;<br></div><div> p_sys->framedrop = FRAMEDROP_NONE;<br></div><div> <br></div><div>+ vlc_mutex_lock(&p_sys->lock);<br></div><div> date_Set( &p_sys->pts, VLC_TICK_INVALID ); /* To make sure we recover properly */<br></div><div>+ vlc_mutex_unlock(&p_sys->lock);<br></div><div>+<br></div><div> cc_Flush( &p_sys->cc );<br></div><div> <br></div><div> if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )<br></div></pre></blockquote></div><div><br></div><div>-- <br></div><div>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. <br></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div>https://mailman.videolan.org/listinfo/vlc-devel<br></div></blockquote><div><br></div></body></html>