]> git.sesse.net Git - mlt/blobdiff - src/modules/xml/producer_xml.c
Fix XML and melt producers producer_avformat cache size.
[mlt] / src / modules / xml / producer_xml.c
index b9c55e2850ba488cda8a4568b72d727d4704e9b1..bc73f49c561092a3f2a151d414d9f95c10755ab8 100644 (file)
@@ -879,6 +879,10 @@ static void on_end_track( deserialise_context context, const xmlChar *name )
                                else if ( strcmp( hide_s, "both" ) == 0 )
                                        mlt_properties_set_int( producer_props, "hide", 3 );
                        }
+
+                       // Set the size of the producer_avformat cache to the number of tracks.
+                       if ( multitrack->count > mlt_service_cache_get_size( MLT_MULTITRACK_SERVICE(multitrack), "producer_avformat" ) )
+                               mlt_service_cache_set_size( MLT_MULTITRACK_SERVICE(multitrack), "producer_avformat", multitrack->count + 2 );
                }
 
                if ( parent != NULL )