return aspect_ratio;
}
-static char* parse_url( mlt_profile profile, const char* URL, AVInputFormat **format, AVFormatParameters **parameters )
+static char* parse_url( mlt_profile profile, const char* URL, AVInputFormat **format, AVFormatParameters *params )
{
if ( !URL ) return NULL;
if ( *format )
{
- // Allocate params
- AVFormatParameters *params = *parameters = calloc( 1, sizeof( AVFormatParameters ) );
-
// These are required by video4linux2 (defaults)
params->width = profile->width;
params->height = profile->height;
// Parse URL
AVInputFormat *format = NULL;
- AVFormatParameters *params = NULL;
+ AVFormatParameters params;
+ memset( ¶ms, 0, sizeof(params) );
char *filename = parse_url( profile, URL, &format, ¶ms );
// Now attempt to open the file or device with filename
- error = av_open_input_file( &self->video_format, filename, format, 0, params ) < 0;
+ error = av_open_input_file( &self->video_format, filename, format, 0, ¶ms ) < 0;
if ( error )
// If the URL is a network stream URL, then we probably need to open with full URL
- error = av_open_input_file( &self->video_format, URL, format, 0, params ) < 0;
+ error = av_open_input_file( &self->video_format, URL, format, 0, ¶ms ) < 0;
// Set MLT properties onto video AVFormatContext
apply_properties( self->video_format, properties, AV_OPT_FLAG_DECODING_PARAM );
#endif
// Cleanup AVFormatParameters
- if ( params )
- {
- if ( params->standard )
- free( (void*) params->standard );
- free( params );
- }
+ if ( params.standard )
+ free( (void*) params.standard );
// If successful, then try to get additional info
if ( !error )