summaryrefslogtreecommitdiff
path: root/libs/ardour/sndfilesource.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/sndfilesource.cc')
-rw-r--r--libs/ardour/sndfilesource.cc21
1 files changed, 7 insertions, 14 deletions
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc
index 83c3c982b0..2bdcdc5a02 100644
--- a/libs/ardour/sndfilesource.cc
+++ b/libs/ardour/sndfilesource.cc
@@ -50,8 +50,6 @@ SndFileSource::SndFileSource (const XMLNode& node)
throw failed_constructor ();
}
}
-
- SourceCreated (this); /* EMIT SIGNAL */
}
SndFileSource::SndFileSource (string idstr, Flag flags)
@@ -71,9 +69,6 @@ SndFileSource::SndFileSource (string idstr, Flag flags)
throw failed_constructor ();
}
}
-
-
- SourceCreated (this); /* EMIT SIGNAL */
}
SndFileSource::SndFileSource (string idstr, SampleFormat sfmt, HeaderFormat hf, jack_nframes_t rate, Flag flags)
@@ -183,9 +178,6 @@ SndFileSource::SndFileSource (string idstr, SampleFormat sfmt, HeaderFormat hf,
throw failed_constructor ();
}
}
-
- SourceCreated (this); /* EMIT SIGNAL */
-
}
void
@@ -235,7 +227,8 @@ SndFileSource::open ()
_length = _info.frames;
- _broadcast_info = (SF_BROADCAST_INFO*) calloc (1, sizeof (SF_BROADCAST_INFO));
+ _broadcast_info = new SF_BROADCAST_INFO;
+ memset (_broadcast_info, 0, sizeof (*_broadcast_info));
/* lookup broadcast info */
@@ -244,7 +237,7 @@ SndFileSource::open ()
/* if the file has data but no broadcast info, then clearly, there is no broadcast info */
if (_length) {
- free (_broadcast_info);
+ delete _broadcast_info;
_broadcast_info = 0;
_flags = Flag (_flags & ~Broadcast);
}
@@ -269,7 +262,7 @@ SndFileSource::open ()
SndFileSource::~SndFileSource ()
{
- GoingAway (this); /* EMIT SIGNAL */
+ GoingAway (); /* EMIT SIGNAL */
if (sf) {
sf_close (sf);
@@ -412,7 +405,7 @@ SndFileSource::write_unlocked (Sample *data, jack_nframes_t cnt)
if (_build_peakfiles) {
- queue_for_peaks (*this);
+ queue_for_peaks (this);
}
_write_data_count = cnt;
@@ -485,7 +478,7 @@ SndFileSource::setup_broadcast_info (jack_nframes_t when, struct tm& now, time_t
if (sf_command (sf, SFC_SET_BROADCAST_INFO, _broadcast_info, sizeof (*_broadcast_info)) != SF_TRUE) {
error << string_compose (_("cannot set broadcast info for audio file %1; Dropping broadcast info for this file"), _path) << endmsg;
_flags = Flag (_flags & ~Broadcast);
- free (_broadcast_info);
+ delete _broadcast_info;
_broadcast_info = 0;
return -1;
}
@@ -506,7 +499,7 @@ SndFileSource::set_header_timeline_position ()
if (sf_command (sf, SFC_SET_BROADCAST_INFO, _broadcast_info, sizeof (*_broadcast_info)) != SF_TRUE) {
error << string_compose (_("cannot set broadcast info for audio file %1; Dropping broadcast info for this file"), _path) << endmsg;
_flags = Flag (_flags & ~Broadcast);
- free (_broadcast_info);
+ delete _broadcast_info;
_broadcast_info = 0;
}
}