]> git.sesse.net Git - vlc/commitdiff
Use picture helpers (Yield,Release,CopyProperties).
authorLaurent Aimar <fenrir@videolan.org>
Fri, 18 Jul 2008 19:18:36 +0000 (21:18 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Fri, 18 Jul 2008 19:18:36 +0000 (21:18 +0200)
32 files changed:
modules/video_filter/adjust.c
modules/video_filter/alphamask.c
modules/video_filter/blendbench.c
modules/video_filter/colorthres.c
modules/video_filter/croppadd.c
modules/video_filter/deinterlace.c
modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
modules/video_filter/erase.c
modules/video_filter/extract.c
modules/video_filter/filter_picture.h
modules/video_filter/gaussianblur.c
modules/video_filter/gradient.c
modules/video_filter/grain.c
modules/video_filter/invert.c
modules/video_filter/logo.c
modules/video_filter/magnify.c
modules/video_filter/mosaic.c
modules/video_filter/motionblur.c
modules/video_filter/motiondetect.c
modules/video_filter/noise.c
modules/video_filter/opencv_wrapper.c
modules/video_filter/postproc.c
modules/video_filter/psychedelic.c
modules/video_filter/ripple.c
modules/video_filter/rotate.c
modules/video_filter/rss.c
modules/video_filter/rv32.c
modules/video_filter/scale.c
modules/video_filter/seamcarving.c
modules/video_filter/sharpen.c
modules/video_filter/swscale.c
modules/video_filter/wave.c

index a3588e82cb0806bceda3b72092f6dd314561dd75..b3781926de974e0b65d4183ebea5362a39ccb91e 100644 (file)
@@ -219,8 +219,7 @@ static picture_t *FilterPlanar( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
@@ -447,8 +446,8 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_pic )
     {
         msg_Warn( p_filter, "Unsupported input chroma (%4s)",
                   (char*)&(p_pic->format.i_chroma) );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+
+        picture_Release( p_pic );
         return NULL;
     }
 
@@ -456,8 +455,8 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+
+        picture_Release( p_pic );
         return NULL;
     }
 
index 1f90294a7caf409daa46b39b42521939bd4da0de..6c0b9f219f68b7a667de8fbc48119f4ad754b0c0 100644 (file)
@@ -135,7 +135,7 @@ static void Destroy( vlc_object_t *p_this )
 
     vlc_mutex_destroy( &p_sys->mask_lock );
     if( p_filter->p_sys->p_mask )
-        p_filter->p_sys->p_mask->pf_release( p_filter->p_sys->p_mask );
+        picture_Release( p_filter->p_sys->p_mask );
 
     free( p_filter->p_sys );
 }
@@ -201,7 +201,7 @@ static void LoadMask( filter_t *p_filter, const char *psz_filename )
     memset( &fmt_out, 0, sizeof( video_format_t ) );
     fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
     if( p_filter->p_sys->p_mask )
-        p_filter->p_sys->p_mask->pf_release( p_filter->p_sys->p_mask );
+        picture_Release( p_filter->p_sys->p_mask );
     p_image = image_HandlerCreate( p_filter );
     p_filter->p_sys->p_mask =
         image_ReadUrl( p_image, psz_filename, &fmt_in, &fmt_out );
@@ -236,7 +236,7 @@ static int MaskCallback( vlc_object_t *p_this, char const *psz_var,
         }
         else if( p_sys->p_mask )
         {
-            p_sys->p_mask->pf_release( p_sys->p_mask );
+            picture_Release( p_sys->p_mask );
             p_sys->p_mask = NULL;
         }
         vlc_mutex_unlock( &p_sys->mask_lock );
index d5a547ee772b35223ec6d57aa3a8f53ae2416d02..ebfeb72c3e8859e2885bed3c7bde9d20d2c7a755 100644 (file)
@@ -200,8 +200,8 @@ static void Destroy( vlc_object_t *p_this )
     filter_t *p_filter = (filter_t *)p_this;
     filter_sys_t *p_sys = p_filter->p_sys;
 
-    p_sys->p_base_image->pf_release( p_sys->p_base_image );
-    p_sys->p_blend_image->pf_release( p_sys->p_blend_image );
+    picture_Release( p_sys->p_base_image );
+    picture_Release( p_sys->p_blend_image );
 }
 
 /*****************************************************************************
@@ -218,7 +218,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     p_blend = vlc_object_create( p_filter, sizeof(filter_t) );
     if( !p_blend )
     {
-        p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
     vlc_object_attach( p_blend, p_filter );
@@ -227,7 +227,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     p_blend->p_module = module_Need( p_blend, "video blending", 0, 0 );
     if( !p_blend->p_module )
     {
-        p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         vlc_object_detach( p_blend );
         vlc_object_release( p_blend );
         return NULL;
index 31f90f07b34ebb29dfcde7ca7a22c7f1941b7254..2a393181a9d9ec6c288c3c45231973f721c993e8 100644 (file)
@@ -166,8 +166,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
index b2c3d2250c573a3a3de3b5a3494e5f1f8aadb6ff..3f17320787f6f64e9268a9ae87119c2844a68fc3 100644 (file)
@@ -219,8 +219,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
index da41364859ffc3226154a883450ce5f50564c80a..9328491d168422682495f889cd4ed26e0222ea49 100644 (file)
@@ -2120,7 +2120,7 @@ static picture_t *Deinterlace( filter_t *p_filter, picture_t *p_pic )
             RenderDiscard( p_vout, p_pic_dst, p_pic, 0 );
 #endif
             msg_Err( p_vout, "discarding lines is not supported yet" );
-            p_pic_dst->pf_release( p_pic_dst );
+            picture_Release( p_pic_dst );
             return p_pic;
             break;
 
@@ -2137,7 +2137,7 @@ static picture_t *Deinterlace( filter_t *p_filter, picture_t *p_pic )
             RenderLinear( p_vout, pp_outpic[1], p_pic, 1 );
 #endif
             msg_Err( p_vout, "doubling the frame rate is not supported yet" );
-            p_pic_dst->pf_release( p_pic_dst );
+            picture_Release( p_pic_dst );
             return p_pic;
             break;
 
@@ -2154,13 +2154,10 @@ static picture_t *Deinterlace( filter_t *p_filter, picture_t *p_pic )
             break;
     }
 
-    p_pic_dst->date = p_pic->date;
-    p_pic_dst->b_force = p_pic->b_force;
-    p_pic_dst->i_nb_fields = p_pic->i_nb_fields;
+    picture_CopyProperties( p_pic_dst, p_pic );
     p_pic_dst->b_progressive = true;
-    p_pic_dst->b_top_field_first = p_pic->b_top_field_first;
 
-    p_pic->pf_release( p_pic );
+    picture_Release( p_pic );
     return p_pic_dst;
 }
 
index 2ec1031281605ff3e70cf197a26cc3ab57be8d07..03e7f2fbb79c83f1f2198a230e0ac12aa0d3de7d 100644 (file)
@@ -512,7 +512,7 @@ static int exec_DataSharedMem( filter_t *p_filter,
             msg_Err( p_filter,
                      "Insufficient data in shared memory. need %zu, got %zu",
                      i_neededsize, i_size );
-            p_ovl->data.p_pic->pf_release( p_ovl->data.p_pic );
+            picture_Release( p_ovl->data.p_pic );
             free( p_ovl->data.p_pic );
             p_ovl->data.p_pic = NULL;
             return VLC_EGENERIC;
@@ -522,7 +522,7 @@ static int exec_DataSharedMem( filter_t *p_filter,
         if( p_data == NULL )
         {
             msg_Err( p_filter, "Unable to attach to shared memory" );
-            p_ovl->data.p_pic->pf_release( p_ovl->data.p_pic );
+            picture_Release( p_ovl->data.p_pic );
             free( p_ovl->data.p_pic );
             p_ovl->data.p_pic = NULL;
             return VLC_ENOMEM;
index d2590482f58ccb76a6937283cebe795b62f8a0de..cde3a8a362b68f8a3b52ca2b220398d54ec7c520 100644 (file)
@@ -107,7 +107,7 @@ static void LoadMask( filter_t *p_filter, const char *psz_filename )
     if( p_filter->p_sys->p_mask )
     {
         if( p_old_mask )
-            p_old_mask->pf_release( p_old_mask );
+            picture_Release( p_old_mask );
     }
     else if( p_old_mask )
     {
@@ -186,7 +186,7 @@ static void Destroy( vlc_object_t *p_this )
     filter_t *p_filter = (filter_t *)p_this;
     filter_sys_t *p_sys = p_filter->p_sys;
     if( p_sys->p_mask )
-        p_sys->p_mask->pf_release( p_sys->p_mask );
+        picture_Release( p_sys->p_mask );
 
     vlc_mutex_destroy( &p_sys->lock );
 
@@ -206,8 +206,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
index 05db7c876ccc8872d54fbebad9229ca0fd9b69d6..7c78400c8752de71e86ab6c15603aac88b383458 100644 (file)
@@ -176,8 +176,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
@@ -241,8 +240,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
         default:
             msg_Warn( p_filter, "Unsupported input chroma (%4s)",
                       (char*)&(p_pic->format.i_chroma) );
-            if( p_pic->pf_release )
-                p_pic->pf_release( p_pic );
+            picture_Release( p_pic );
             return NULL;
     }
 
index df5b33fed2c295e0d65671cf47ebe4639b0f5192..b39a26637c9b0e9e036aff5363016757cc8fd854 100644 (file)
@@ -88,14 +88,9 @@ static inline int GetPackedYuvOffsets( vlc_fourcc_t i_chroma,
  *****************************************************************************/
 static inline picture_t *CopyInfoAndRelease( picture_t *p_outpic, picture_t *p_inpic )
 {
-    p_outpic->date = p_inpic->date;
-    p_outpic->b_force = p_inpic->b_force;
-    p_outpic->i_nb_fields = p_inpic->i_nb_fields;
-    p_outpic->b_progressive = p_inpic->b_progressive;
-    p_outpic->b_top_field_first = p_inpic->b_top_field_first;
+    picture_CopyProperties( p_outpic, p_inpic );
 
-    if( p_inpic->pf_release )
-        p_inpic->pf_release( p_inpic );
+    picture_Release( p_inpic );
 
     return p_outpic;
 }
index 357cc035b81a7c09071c978fcabe83a13049db00..8d71f956a1d63ce1f98b06e8fe1661fa26eed264 100644 (file)
@@ -216,8 +216,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 #ifdef DONT_USE_FLOATS
index ade94b9252ab828540df080ec329dc8c3ecdf33b..ac10a35132866513a5db872f38e037182dfe8abe 100644 (file)
@@ -237,8 +237,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
index dd07768e0dd6cecd50549ffb451e8069ce60cd5c..8826628e2485e28d01b922be2d6ede42e757b238 100644 (file)
@@ -110,8 +110,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
index acf093ea0fa642ac2eebf2a1d65e5da000d2289b..df1a168b12f404faf4e979d841c292f98d6492e2 100644 (file)
@@ -117,8 +117,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
index 016c2ff5d97d2fc71295bc3e85e1f7a9682aa316..541fc196a14a1063d95cf27b08f9514b328a4f51 100644 (file)
@@ -279,7 +279,7 @@ static void FreeLogoList( logo_list_t *p_logo_list )
         FREENULL( p_logo->psz_file );
         if( p_logo->p_pic )
         {
-            p_logo->p_pic->pf_release( p_logo->p_pic );
+            picture_Release( p_logo->p_pic );
             p_logo->p_pic = NULL;
         }
     }
index 9d9d8a08ab82660681fb722a94309be068557b2f..316cfcaff3fa41a4e56aa22974babe8edacd1f36 100644 (file)
@@ -380,7 +380,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
                 p_converted->p[i_plane].i_visible_pitch );
             }
         }
-        p_converted->pf_release( p_converted );
+        picture_Release( p_converted );
 
         /* white rectangle on visualization */
         v_w = p_oyp->i_pitch*ZOOM_FACTOR/(VIS_ZOOM*o_zoom);
@@ -461,7 +461,6 @@ o o X o o o X X X X X o o X X X X o o o X X X X X o o X X X o o o X X X o o X o
             }
         }
     }
-
     vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic );
 }
 
index 30cba8f62c6f6db68dffaae8b2c57d4db3b11bf1..19cbdebc4bfaa4a977591cb6457b9f7f7a45499e 100644 (file)
@@ -426,7 +426,7 @@ static void MosaicReleasePicture( picture_t *p_picture )
 {
     picture_t *p_original_pic = (picture_t *)p_picture->p_sys;
 
-    p_original_pic->pf_release( p_original_pic );
+    picture_Release( p_original_pic );
 }
 
 /*****************************************************************************
@@ -546,14 +546,14 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
             if ( p_es->p_picture->p_next != NULL )
             {
                 picture_t *p_next = p_es->p_picture->p_next;
-                p_es->p_picture->pf_release( p_es->p_picture );
+                p_original_pic( p_es->p_picture );
                 p_es->p_picture = p_next;
             }
             else if ( p_es->p_picture->date + p_sys->i_delay + BLANK_DELAY <
                         date )
             {
                 /* Display blank */
-                p_es->p_picture->pf_release( p_es->p_picture );
+                picture_Release( p_es->p_picture );
                 p_es->p_picture = NULL;
                 p_es->pp_last = &p_es->p_picture;
                 break;
@@ -633,7 +633,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         else
         {
             p_converted = p_es->p_picture;
-            p_converted->i_refcount++;
+            picture_Yield( p_converted );
             fmt_in.i_width = fmt_out.i_width = p_converted->format.i_width;
             fmt_in.i_height = fmt_out.i_height = p_converted->format.i_height;
             fmt_in.i_chroma = fmt_out.i_chroma = p_converted->format.i_chroma;
index 53ce82b2d7214953e1d7ea70e92d1f03e5fe449b..42043ab8ee6d4b8db76719bb73b3faeb26f85656 100644 (file)
@@ -141,8 +141,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
index 9c91fd59ed623565a1b2a3d3b436a5ebdec49247..4b80c7a6096003c98fc817cf81493c5889db4214 100644 (file)
@@ -184,8 +184,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_inpic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_inpic->pf_release )
-            p_inpic->pf_release( p_inpic );
+        picture_Release( p_inpic );
         return NULL;
     }
 
@@ -372,8 +371,7 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_inpic )
     {
         msg_Warn( p_filter, "Unsupported input chroma (%4s)",
                   (char*)&(p_inpic->format.i_chroma) );
-        if( p_inpic->pf_release )
-            p_inpic->pf_release( p_inpic );
+        picture_Release( p_inpic );
         return NULL;
     }
 
@@ -401,8 +399,7 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_inpic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_inpic->pf_release )
-            p_inpic->pf_release( p_inpic );
+        picture_Release( p_inpic );
         return NULL;
     }
 
index 030ca2ba1ea96a5fa0a3f60a0461c3a90a7d670b..1c461bc0491ce18465b3a919f28161f90a3cb09a 100644 (file)
@@ -123,8 +123,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
index 7192d9f26ea24a156b9b4be46d10030e419476e1..e6b1dd160e75463de469dbbce76b6004e8c5d4c9 100644 (file)
@@ -435,7 +435,7 @@ static void ReleaseImages(vout_thread_t *p_vout)
     /* Release temp picture_t if it exists */
     if (p_vout->p_sys->p_to_be_freed)
     {
-        p_vout->p_sys->p_to_be_freed->pf_release( p_vout->p_sys->p_to_be_freed );
+        picture_Release( p_vout->p_sys->p_to_be_freed );
         p_vout->p_sys->p_to_be_freed = NULL;
     }
     if (p_vout->p_sys->i_verbosity > VERB_WARN)
index 85326a571ba28aeca99e6fcc5c97163e2216f462..83b309988f8d65883fe33078f6eeb7f4621bff08 100644 (file)
@@ -278,8 +278,7 @@ static picture_t *PostprocPict( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         vlc_mutex_unlock( &p_sys->lock );
         return NULL;
     }
index 271533de8de8594ea6e053ed5bef2ce6fe5aa5e3..7a9540acb16c1bfb6e50f8908b9e783767497412 100644 (file)
@@ -146,8 +146,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
@@ -189,25 +188,25 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( p_converted )
     {
 #define copyimage( plane, b ) \
-    for( y=0; y<p_converted->p[plane].i_visible_lines; y++) { \
-    for( x=0; x<p_converted->p[plane].i_visible_pitch; x++) { \
-        int nx, ny; \
-        if( p_filter->p_sys->yinc == 1 ) \
-            ny= y; \
-        else \
-            ny = p_converted->p[plane].i_visible_lines-y; \
-        if( p_filter->p_sys->xinc == 1 ) \
-            nx = x; \
-        else \
-            nx = p_converted->p[plane].i_visible_pitch-x; \
-        p_outpic->p[plane].p_pixels[(p_filter->p_sys->x*b+nx)+(ny+p_filter->p_sys->y*b)*p_outpic->p[plane].i_pitch ] = p_converted->p[plane].p_pixels[y*p_converted->p[plane].i_pitch+x]; \
-    } }
-    copyimage( Y_PLANE, 2 );
-    copyimage( U_PLANE, 1 );
-    copyimage( V_PLANE, 1 );
+        for( y=0; y<p_converted->p[plane].i_visible_lines; y++) { \
+        for( x=0; x<p_converted->p[plane].i_visible_pitch; x++) { \
+            int nx, ny; \
+            if( p_filter->p_sys->yinc == 1 ) \
+                ny= y; \
+            else \
+                ny = p_converted->p[plane].i_visible_lines-y; \
+            if( p_filter->p_sys->xinc == 1 ) \
+                nx = x; \
+            else \
+                nx = p_converted->p[plane].i_visible_pitch-x; \
+            p_outpic->p[plane].p_pixels[(p_filter->p_sys->x*b+nx)+(ny+p_filter->p_sys->y*b)*p_outpic->p[plane].i_pitch ] = p_converted->p[plane].p_pixels[y*p_converted->p[plane].i_pitch+x]; \
+        } }
+        copyimage( Y_PLANE, 2 );
+        copyimage( U_PLANE, 1 );
+        copyimage( V_PLANE, 1 );
 #undef copyimage
 
-    p_converted->pf_release( p_converted );
+        picture_Release( p_converted );
     }
     else
     {
index 00108565401be8a5d1df385c0501beec77a629c0..eb9d2f5491c3bc1a9a61abc465ec84ec09ce6025 100644 (file)
@@ -125,8 +125,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
index e185a33ce4b5909ff641f8370cc998184fa90801..2fdf4408ece083e4783d1041e54538420d7218ec 100644 (file)
@@ -176,8 +176,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
@@ -301,8 +300,7 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_pic )
     {
         msg_Warn( p_filter, "Unsupported input chroma (%4s)",
                   (char*)&(p_pic->format.i_chroma) );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
@@ -310,8 +308,7 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
index cd75d9280cf2f1736a6237fff30a276e104ebfd6..6f4615adbd55d02e1c5b2fe58aa226d3c77f22fc 100644 (file)
@@ -608,7 +608,7 @@ static picture_t *LoadImage( filter_t *p_filter, const char *psz_url )
         fmt_out.i_height = p_sys->p_style->i_font_size;
 
         p_pic = image_Convert( p_handler, p_orig, &fmt_in, &fmt_out );
-        p_orig->pf_release( p_orig );
+        picture_Release( p_orig );
         if( !p_pic )
         {
             msg_Warn( p_filter, "Error while converting %s", psz_url );
@@ -976,7 +976,7 @@ static void FreeRSS( filter_t *p_filter)
         free( p_feed->psz_description );
         free( p_feed->psz_image );
         if( p_feed->p_pic != NULL )
-            p_feed->p_pic->pf_release( p_feed->p_pic );
+            picture_Release( p_feed->p_pic );
     }
     free( p_sys->p_feeds );
     p_sys->i_feeds = 0;
index 1e4572bcc46409f0e55be137dba7157b8127e213..89c1aa2ef49582e3deed1173c138b4ddf2074496 100644 (file)
@@ -109,8 +109,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_pic_dst )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
@@ -136,13 +135,9 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
         }
     }
 
-    p_pic_dst->date = p_pic->date;
-    p_pic_dst->b_force = p_pic->b_force;
-    p_pic_dst->i_nb_fields = p_pic->i_nb_fields;
-    p_pic_dst->b_progressive = p_pic->b_progressive;
-    p_pic_dst->b_top_field_first = p_pic->b_top_field_first;
+    picture_CopyProperties( p_pic_dst, p_pic );
+    picture_Release( p_pic );
 
-    p_pic->pf_release( p_pic );
     return p_pic_dst;
 }
 
index 726d51315e1b67aac32adf09588744f0671f627a..01033b8d00e4112357091411161c0b10cbc1a9e9 100644 (file)
@@ -128,8 +128,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_pic_dst )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
@@ -225,13 +224,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
         }
     }
 
-    p_pic_dst->date = p_pic->date;
-    p_pic_dst->b_force = p_pic->b_force;
-    p_pic_dst->i_nb_fields = p_pic->i_nb_fields;
-    p_pic_dst->b_progressive = p_pic->b_progressive;
-    p_pic_dst->b_top_field_first = p_pic->b_top_field_first;
-
-    if( p_pic->pf_release )
-        p_pic->pf_release( p_pic );
+    picture_CopyProperties( p_pic_dst, p_pic );
+    picture_Release( p_pic );
     return p_pic_dst;
 }
index e622370674f2d6068d7e77e6428bf34335d24c65..cd0edac3dd90d9c8b79b30c90474b9c827964aa6 100644 (file)
@@ -117,8 +117,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
index ea5b9d03c774a3ce6c764576867d9f43fe29d9a2..e975466927e49b70b133431d7eea09c520132b89 100644 (file)
@@ -176,8 +176,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
@@ -187,8 +186,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_src || !p_out )
     {
         msg_Warn( p_filter, "can't get Y plane" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
index 3651b81e3aaba26346f294537f3c932fb2bdd76a..5e0e8d0928ada326ec7c6b094f00f4a7844a3a1b 100644 (file)
@@ -321,14 +321,8 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
                dst, dst_stride );
 #endif
 
-    p_pic_dst->date = p_pic->date;
-    p_pic_dst->b_force = p_pic->b_force;
-    p_pic_dst->i_nb_fields = p_pic->i_nb_fields;
-    p_pic_dst->b_progressive = p_pic->b_progressive;
-    p_pic_dst->b_top_field_first = p_pic->b_top_field_first;
-
-    if( p_pic->pf_release )
-        p_pic->pf_release( p_pic );
+    picture_CopyProperties( p_pic_dst, p_pic );
+    picture_Release( p_pic );
     return p_pic_dst;
 }
 
index 36f740c2c8f4c184984c34cec1f77e9dec28dac4..0a154a0240706f8da93045b849979346d8f9290b 100644 (file)
@@ -126,8 +126,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }