<p dir="ltr"></p>
<p dir="ltr">On Sep 7, 2016 12:36, "Thomas Guillem" <<a href="mailto:thomas@gllm.fr">thomas@gllm.fr</a>> wrote:<br>
><br>
> Don't treat EAGAIN as an error<br>
> ---<br>
> modules/codec/avcodec/video.c | 16 ++++++++++++++--<br>
> 1 file changed, 14 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c<br>
> index f236224..dd35dff 100644<br>
> --- a/modules/codec/avcodec/video.c<br>
> +++ b/modules/codec/avcodec/video.c<br>
> @@ -833,11 +833,23 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )<br>
> p_block->i_dts = VLC_TS_INVALID;<br>
> }<br>
><br>
> - int not_able_to_send_packet = avcodec_send_packet( p_context, &pkt );<br>
> + int ret = avcodec_send_packet( p_context, &pkt );<br>
> i_used = pkt.size;<br>
> av_packet_unref( &pkt );<br>
><br>
> - int not_received_frame = avcodec_receive_frame( p_context, frame);<br>
> + if( ret != 0 && ret != AVERROR(EAGAIN) )<br>
> + {<br>
> + p_dec->b_error = true;<br>
> + break;<br>
> + }<br>
> +<br>
> + ret = avcodec_receive_frame( p_context, frame);<br>
> + if( ret != 0 && ret != AVERROR(EAGAIN) )<br>
> + {<br>
> + p_dec->b_error = true;<br>
> + break;<br>
> + }<br>
> + int not_received_frame = ret;<br>
><br>
> wait_mt( p_sys );<br>
></p>
<p dir="ltr">Notwithstanding Rémi's concerns, would this be better written as a while() loop, on the off chance EAGAIN is returned more than once?</p>
<p dir="ltr">-- Sean McG.<br><br></p>