- if( asprintf( &psz_output, "std{access=file,mux='%s',dst='%s%s%s'}",
- psz_muxer, psz_prefix, psz_extension ? "." : "", psz_extension ? psz_extension : "" ) < 0 )
- return -1;
+ if( asprintf( &psz_file, "%s%s%s",
+ psz_prefix, psz_extension ? "." : "", psz_extension ? psz_extension : "" ) < 0 )
+ {
+ psz_file = NULL;
+ goto error;
+ }
+
+ if( asprintf( &psz_output, "std{access=file,mux='%s',dst='%s'}",
+ psz_muxer, psz_file ) < 0 )
+ {
+ psz_output = NULL;
+ goto error;
+ }