From 23a0efc286143d66ebea0b99626ad1df895f591f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 29 Nov 2022 20:00:15 +0100 Subject: [PATCH] Indicate error when parsing session fails --- libs/ardour/session_state.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 6cf035f984..ce5a9aa57f 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -4857,13 +4857,13 @@ Session::get_info_from_path (const string& xmlpath, float& sample_rate, SampleFo xmlParserCtxtPtr ctxt = xmlNewParserCtxt(); if (ctxt == NULL) { - return -1; + return -2; } xmlDocPtr doc = xmlCtxtReadFile (ctxt, xmlpath.c_str(), NULL, XML_PARSE_HUGE); if (doc == NULL) { xmlFreeParserCtxt(ctxt); - return -1; + return -2; } xmlNodePtr node = xmlDocGetRootElement(doc); @@ -4871,7 +4871,7 @@ Session::get_info_from_path (const string& xmlpath, float& sample_rate, SampleFo if (node == NULL) { xmlFreeParserCtxt(ctxt); xmlFreeDoc (doc); - return -1; + return -2; } /* sample rate & version*/ @@ -4888,7 +4888,7 @@ Session::get_info_from_path (const string& xmlpath, float& sample_rate, SampleFo } if ((parse_stateful_loading_version(version) / 1000L) > (CURRENT_SESSION_FILE_VERSION / 1000L)) { - return -1; + return -3; } if ((parse_stateful_loading_version(version) / 1000L) <= 2) {