[vlc-devel] [PATCH] Puzzle filter enhancement

Jean-Baptiste Kempf jb at videolan.org
Fri Jan 18 14:02:10 CET 2013


On 18 Jan, Vianney BOYER wrote :
> You may have supposed that my first objective was to obtain a working executable without any warning when compiling it on my computer! ...and without any segmentation fault...

Yes :)

> Anyway, I understand your remarks as you want a code that anyone will be able to understand the code and change it when needed.

The objective is also to be able to maintain it :)

> I'll do all the modification you've requested as, myself, I was happy to understand and find in the other files of this project some help for specific issues.
> Please be indulgent as this is my first contribution on such project and I'm not aware of such "best practice".

We fully understand that, and we know how hard it is to start.

> 2/ Sometimes I use this original/basic puzzle mode. It's just different: a sliding puzzle instead of a jigsaw game.

Then don't call it advanced but sliding/jigsaw.

>     >> +struct filter_sys_t {
>     >> +    bool b_init;
>     >> +    bool b_bake_request;
>     >> +    bool b_shape_init;
>     >> +    param_t s_allocated;
>     >> +    param_t s_current_param;
>     >> +    param_t s_new_param;
>     >No param_t* ?
> Why?

Increasing your struct a bit too much maybe?

>     >> +    p_sys->ps_bezier_pts_H = malloc( sizeof( point_t *) * SHAPES_QTY );
>     >Check your malloc. You should check this on all your code.
> You'll kill me but where is the mistake? ps_bezier_pts_H is of type point_t **

I will not kill you. I've already eaten 2 young children this morning.
No, the mistake is that malloc can return NULL.

>     >> +                    int32_t i_group_ID = p_sys->ps_pieces[0].i_group_ID;
>     >Why not a uint32_t btw?
> changed. (Why? because at the begining I was using -1 for stand alone pieces...)

hmm, ok.

> 15 to be exact!
> I've reduced it to 13 by merging 3 if statements.

Can you do more? Like splitting in more functions?

> At the begining I wanted to implement a load/save function. But I was unable to modify GUI to set parameters as per loaded data.
> I couldn't find any example in the other filters. How can I do that?

No idea, but using fopen and not vlc_ functions is really weird.

Best regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list