+ /* Return NULL if no input module wanted to touch this. */
+ if (!inputs[i]) {
+ g_critical("Error: no matching input module found.");
+ return NULL;
+ }
+
+ return inputs[i];
+}
+
+sr_input* SigSession::load_input_file_format(const string &filename,
+ function<void (const QString)> error_handler,
+ sr_input_format *format)
+{
+ struct stat st;
+ sr_input *in;
+
+ if (!format && !(format =
+ determine_input_file_format(filename.c_str()))) {
+ /* The exact cause was already logged. */
+ return NULL;
+ }
+
+ if (stat(filename.c_str(), &st) == -1) {
+ error_handler(tr("Failed to load file"));
+ return NULL;
+ }
+
+ /* Initialize the input module. */
+ if (!(in = new sr_input)) {
+ qDebug("Failed to allocate input module.\n");
+ return NULL;