if ( mlt_properties_get( properties, "meta.volume" ) )
{
double value = mlt_properties_get_double( properties, "meta.volume" );
+
if ( value == 0.0 )
{
memset( *buffer, 0, *samples * *channels * 2 );
- mlt_properties_set_double( properties, "meta.volume", 1.0 );
}
else if ( value != 1.0 )
{
*p = *p * value;
p ++;
}
- mlt_properties_set_double( properties, "meta.volume", 1.0 );
}
+
+ mlt_properties_set( properties, "meta.volume", NULL );
}
return 0;
if ( input != NULL && ( iwidth != owidth || iheight != oheight ) && ( owidth > 6 && oheight > 6 ) )
{
- uint8_t *in_line = input;
uint8_t *out_line;
+ int offset_x = ( owidth - iwidth ) / 2;
+ int offset_y = ( oheight - iheight ) / 2;
+ int iused = iwidth;
output = mlt_pool_alloc( owidth * oheight );
memset( output, 0, owidth * oheight );
- out_line = output + ( ( oheight - iheight ) / 2 ) * owidth;
- out_line += 2 * ( int )( ( owidth - iwidth ) / 2 );
+ offset_x -= offset_x % 2;
+
+ out_line = output + offset_y * owidth;
+ out_line += offset_x;
// Loop for the entirety of our output height.
while ( iheight -- )
{
// We're in the input range for this row.
- memcpy( out_line, input, iwidth );
+ memcpy( out_line, input, iused );
// Move to next input line
- in_line += iwidth;
+ input += iwidth;
// Move to next output line
out_line += owidth;
// Calculate strides
int istride = iwidth * 2;
int ostride = owidth * 2;
+ int offset_x = ( owidth - iwidth );
+ int offset_y = ( oheight - iheight ) / 2;
+ uint8_t *in_line = input;
+ uint8_t *out_line;
+ int size = owidth * oheight;
+ uint8_t *p = output;
// Optimisation point
if ( output == NULL || input == NULL || ( owidth <= 6 || oheight <= 6 || iwidth <= 6 || oheight <= 6 ) )
return;
}
- uint8_t *in_line = input;
- uint8_t *out_line;
-
- int size = owidth * oheight;
- uint8_t *p = output;
-
while( size -- )
{
*p ++ = 16;
*p ++ = 128;
}
- out_line = output + ( ( oheight - iheight ) / 2 ) * ostride;
- out_line += 4 * ( int )( ( owidth - iwidth ) / 4 );
-
+ offset_x -= offset_x % 4;
+
+ out_line = output + offset_y * ostride;
+ out_line += offset_x;
+
// Loop for the entirety of our output height.
while ( iheight -- )
{
// We're in the input range for this row.
- memcpy( out_line, in_line, istride );
+ memcpy( out_line, in_line, iwidth * 2 );
// Move to next input line
in_line += istride;
alpha = mlt_resize_alpha( alpha, owidth, oheight, iwidth, iheight );
if ( alpha != NULL )
{
- mlt_properties_set_data( properties, "alpha", alpha, owidth * ( oheight + 1 ), ( mlt_destructor )mlt_pool_release, NULL );
+ mlt_properties_set_data( properties, "alpha", alpha, owidth * oheight, ( mlt_destructor )mlt_pool_release, NULL );
this->get_alpha_mask = NULL;
}