vlc | branch: master | Zhao Zhili <[email protected]> | Thu Oct 8 18:18:00 2020 +0200| [71af7f552ce2f3198c4a3acd4f34229dcef3a45a] | committer: Steve Lhomme
avcodec: use bool type for b_dr_failure Since it's been protected by lock again. Signed-off-by: Steve Lhomme <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=71af7f552ce2f3198c4a3acd4f34229dcef3a45a --- modules/codec/avcodec/video.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c index 6a30ef8400..a4fc843e9f 100644 --- a/modules/codec/avcodec/video.c +++ b/modules/codec/avcodec/video.c @@ -92,7 +92,7 @@ typedef struct /* for direct rendering */ bool b_direct_rendering; - atomic_bool b_dr_failure; + bool b_dr_failure; /* Protected by lock */ /* Hack to force display of still pictures */ bool b_first_frame; @@ -498,7 +498,7 @@ int InitVideoDec( vlc_object_t *obj ) /* ***** libavcodec direct rendering ***** */ p_sys->b_direct_rendering = false; - atomic_init(&p_sys->b_dr_failure, false); + p_sys->b_dr_failure = false; if( var_CreateGetBool( p_dec, "avcodec-dr" ) && (p_codec->capabilities & AV_CODEC_CAP_DR1) && /* No idea why ... but this fixes flickering on some TSCC streams */ @@ -1422,15 +1422,17 @@ static int lavc_dr_GetFrame(struct AVCodecContext *ctx, AVFrame *frame) { if (pic->p[i].i_pitch % aligns[i]) { - if (!atomic_exchange(&sys->b_dr_failure, true)) + if (sys->b_dr_failure == false) msg_Warn(dec, "plane %d: pitch not aligned (%d%%%d): disabling direct rendering", i, pic->p[i].i_pitch, aligns[i]); + sys->b_dr_failure = true; goto error; } if (((uintptr_t)pic->p[i].p_pixels) % aligns[i]) { - if (!atomic_exchange(&sys->b_dr_failure, true)) + if (sys->b_dr_failure == false) msg_Warn(dec, "plane %d not aligned: disabling direct rendering", i); + sys->b_dr_failure = true; goto error; } } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
