Hi all,
While investigating a crash in Kdenlive when using embedded xml
playlists using the producer_consumer, I found the following:
For some reason, the "consumer" producer destroys the audio buffer when
requesting the same frame several times. This leads in Kdenlive to a
crash, because the audio buffer is deleted while being used in
filter_convert.c because of a mix audio transition. This situation
happens when requesting a monitor refresh on the same frame while on pause.
So I had a look at the consumer_producer code and I am puzzled by the
code destroying the audio buffer in get_audio:
https://github.com/mltframework/mlt/blob/b6a8771d3c2a2de8d6b96eb06eb72b5e0c45138e/src/modules/core/producer_consumer.c#L102
I am not sure why this is done here, maybe in case a frame is requested
twice because of a different framerate ? But this causes a crash when
requesting the same frame when producer is paused.
Adding a check like:
mlt_producer producer = mlt_frame_get_original_producer( frame );
if ( mlt_producer_get_speed( producer ) != 0 ) {
*samples = 0;
*buffer = NULL;
}
Fixes the crash (don't delete buffer if requesting same frame on pause),
but since I am not familiar with MLT's audio workflow, I would like to
hear your opinion..
Thanks
Jean-Baptiste
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel