13
0

Prevent leaking "recorder:" into the file-name

This is safeguard. It should not happen since _write_source_name
once Track::set_name () sets this unconditionally.
This commit is contained in:
Robin Gareus 2021-03-15 21:28:52 +01:00
parent 1d106c88ca
commit bb50925998
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 15 additions and 7 deletions

View File

@ -58,13 +58,7 @@ public:
bool set_write_source_name (const std::string& str);
std::string write_source_name () const {
if (_write_source_name.empty ()) {
return name ();
} else {
return _write_source_name;
}
}
std::string write_source_name () const;
boost::shared_ptr<AudioFileSource> audio_write_source (uint32_t n = 0) {
boost::shared_ptr<ChannelList> c = channels.reader ();

View File

@ -129,6 +129,20 @@ DiskWriter::set_write_source_name (string const & str)
return true;
}
std::string
DiskWriter::write_source_name () const
{
if (!_write_source_name.empty ()) {
return _write_source_name;
}
std::string const& n (name ());
if (n.find (X_("recorder:")) == 0 && n.size () > 9) {
return n.substr (9);
}
return n;
}
void
DiskWriter::check_record_status (samplepos_t transport_sample, double speed, bool can_record)
{