[vlc-commits] deinterlace: Don't copy picture, just hold reference
Ilkka Ollakka
git at videolan.org
Sun Feb 5 13:05:28 CET 2017
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Thu Oct 27 12:20:12 2016 +0300| [53e1f20e122d375286ff9df293904544ff26b457] | committer: Ilkka Ollakka
deinterlace: Don't copy picture, just hold reference
Checking deinterlace filters, seems that copy the picture if they change it, so
pp_history seems to be really read-only.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=53e1f20e122d375286ff9df293904544ff26b457
---
modules/video_filter/deinterlace/deinterlace.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/modules/video_filter/deinterlace/deinterlace.c b/modules/video_filter/deinterlace/deinterlace.c
index 9123add..8f7d575 100644
--- a/modules/video_filter/deinterlace/deinterlace.c
+++ b/modules/video_filter/deinterlace/deinterlace.c
@@ -299,12 +299,10 @@ picture_t *Deinterlace( filter_t *p_filter, picture_t *p_pic )
needs it. */
if( p_sys->b_use_frame_history )
{
- /* Duplicate the picture
- * TODO when the vout rework is finished, picture_Hold() might be enough
- * but becarefull, the pitches must match */
- picture_t *p_dup = picture_NewFromFormat( &p_pic->format );
- if( p_dup )
- picture_Copy( p_dup, p_pic );
+ /* Keep reference for the picture */
+ picture_t *p_dup = picture_Hold( p_pic );
+ if( unlikely( p_dup == NULL ) )
+ return NULL;
/* Slide the history */
if( p_sys->pp_history[0] )
More information about the vlc-commits
mailing list