tweak Stateful/StatefulDiffCommand changes so that SessionObject's actually get a...
[ardour.git] / libs / ardour / sndfilesource.cc
index 64cad0f2b614c90e695e3c9e3c11490126b1e885..de8ce330e1a72d396c9a7ce26565640117dce9c1 100644 (file)
@@ -192,8 +192,7 @@ SndFileSource::init_sndfile ()
                _timeline_position = header_position_offset;
        }
 
-       AudioFileSource::HeaderPositionOffsetChanged.connect (
-                       boost::bind (&SndFileSource::handle_header_position_change, this));
+       AudioFileSource::HeaderPositionOffsetChanged.connect_same_thread (header_position_connection, boost::bind (&SndFileSource::handle_header_position_change, this));
 }
 
 int
@@ -247,8 +246,6 @@ SndFileSource::open ()
 
 SndFileSource::~SndFileSource ()
 {
-       drop_references ();
-
        if (sf) {
                sf_close (sf);
                sf = 0;
@@ -309,7 +306,7 @@ SndFileSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const
                if (sf_seek (sf, (sf_count_t) start, SEEK_SET|SFM_READ) != (sf_count_t) start) {
                        char errbuf[256];
                        sf_error_str (0, errbuf, sizeof (errbuf) - 1);
-                       error << string_compose(_("SndFileSource: could not seek to frame %1 within %2 (%3)"), start, _name.substr (1), errbuf) << endmsg;
+                       error << string_compose(_("SndFileSource: could not seek to frame %1 within %2 (%3)"), start, _name.val().substr (1), errbuf) << endmsg;
                        return 0;
                }
 
@@ -319,7 +316,7 @@ SndFileSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const
                        if (ret != file_cnt) {
                                char errbuf[256];
                                sf_error_str (0, errbuf, sizeof (errbuf) - 1);
-                               cerr << string_compose(_("SndFileSource: @ %1 could not read %2 within %3 (%4) (len = %5)"), start, file_cnt, _name.substr (1), errbuf, _length) << endl;
+                               cerr << string_compose(_("SndFileSource: @ %1 could not read %2 within %3 (%4) (len = %5)"), start, file_cnt, _name.val().substr (1), errbuf, _length) << endl;
                        }
                        return ret;
                }