On Thu, Oct 14, 2010 at 4:47 PM, j-b-m <[email protected]> wrote:
> Hi.
>
> Working on Kdenlive's clip properties dialog, I noticed a reproducible crash
> when forcing a clip's aspect ratio and then resetting it to default.
>
> In Kdenlive, when we want to reset a property, we use for example:
>
> producer->set("force_aspect_ratio", (const char*) NULL);
>
> Is there a better way to remove a property?
No, that is the correct way.
> If not, the patch below fixes the crash.
That is strange. You are supposed to be able to get a property that
does not exist and get 0 if getting a numeric or NULL if string. There
is a *a lot* of code that makes this assumption. So, we have to see
why it is needed here. Is it a race condition?
On the note of "force_aspect_ratio" in Kdenlive, I am about to add a
color space and luma range overrides in Advanced clip properties. At
the same time, I wanted to change pixel aspect ratio to display aspect
using 2 int fields with a colon in the middle. Are you okay with that?
> regards
> jb
>
>
>
> index 6763dba..951ff51 100644
> --- a/src/modules/avformat/producer_avformat.c
> +++ b/src/modules/avformat/producer_avformat.c
> @@ -1663,7 +1663,11 @@ static void producer_set_up_video( producer_avformat
> this, mlt_frame frame )
> if ( context && index > -1 && video_codec_init( this, index,
> properties ) )
> {
> // Set the frame properties
> - double force_aspect_ratio = mlt_properties_get_double(
> properties, "force_aspect_ratio" );
> + double force_aspect_ratio = 0.0;
> + if ( mlt_properties_get( properties, "force_aspect_ratio" ) )
> + {
> + force_aspect_ratio = mlt_properties_get_double(
> properties, "force_aspect_ratio" );
> + }
> double aspect_ratio = ( force_aspect_ratio > 0.0 ) ?
> force_aspect_ratio : mlt_properties_get_double(
> properties, "aspect_ratio" );
>
--
+-DRD-+
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Mlt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mlt-devel