vlc | branch: master | Steve Lhomme <[email protected]> | Thu Sep 17 14:22:31 2020 +0200| [6bedd49b02b04823baef9eb9a315161a6a7105e3] | committer: Steve Lhomme
mosaic: simplify the picture chain tail handling Rather than a pointer on the last picture pointer, we use either NULL (no tail/chain empty) or a pointer to the last picture in the chain. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6bedd49b02b04823baef9eb9a315161a6a7105e3 --- modules/spu/mosaic.c | 2 +- modules/spu/mosaic.h | 2 +- modules/stream_out/mosaic_bridge.c | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/spu/mosaic.c b/modules/spu/mosaic.c index b06ca3fd6f..1b9a1ee8c7 100644 --- a/modules/spu/mosaic.c +++ b/modules/spu/mosaic.c @@ -544,7 +544,7 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date ) /* Display blank */ picture_Release( p_es->p_picture ); p_es->p_picture = NULL; - p_es->pp_last = &p_es->p_picture; + p_es->tail = NULL; break; } else diff --git a/modules/spu/mosaic.h b/modules/spu/mosaic.h index 41bd00950d..cebd24c83a 100644 --- a/modules/spu/mosaic.h +++ b/modules/spu/mosaic.h @@ -25,7 +25,7 @@ typedef struct bridged_es_t { es_format_t fmt; picture_t *p_picture; - picture_t **pp_last; + picture_t *tail; bool b_empty; char *psz_id; diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c index 518ea73b30..bf05c16a08 100644 --- a/modules/stream_out/mosaic_bridge.c +++ b/modules/stream_out/mosaic_bridge.c @@ -417,7 +417,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt ) //p_es->fmt = *p_fmt; p_es->psz_id = p_sys->psz_id; p_es->p_picture = NULL; - p_es->pp_last = &p_es->p_picture; + p_es->tail = NULL; p_es->b_empty = false; vlc_global_unlock( VLC_MOSAIC_MUTEX ); @@ -571,9 +571,12 @@ static void decoder_queue_video( decoder_t *p_dec, picture_t *p_pic ) /* push the picture in the mosaic-struct structure */ bridged_es_t *p_es = p_sys->p_es; vlc_global_lock( VLC_MOSAIC_MUTEX ); - *p_es->pp_last = p_new_pic; + if (p_es->p_picture == NULL) + p_es->p_picture = p_new_pic; + else + p_es->tail->p_next = p_new_pic; p_new_pic->p_next = NULL; - p_es->pp_last = &p_new_pic->p_next; + p_es->tail = p_new_pic; vlc_global_unlock( VLC_MOSAIC_MUTEX ); } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
