13
0

fix detecting .flac format

This commit is contained in:
Robin Gareus 2016-09-25 22:20:08 +02:00
parent f7f87342c1
commit 6298246a00

View File

@ -342,7 +342,7 @@ SndFileSource::open ()
return -1; return -1;
} }
if (_info.format & SF_FORMAT_FLAC) { if ((_info.format & SF_FORMAT_TYPEMASK ) == SF_FORMAT_FLAC) {
assert (!writable()); assert (!writable());
_sndfile = sf_open_fd (fd, SFM_READ, &_info, true); _sndfile = sf_open_fd (fd, SFM_READ, &_info, true);
} else { } else {
@ -776,7 +776,7 @@ SndFileSource::set_header_timeline_position ()
framecnt_t framecnt_t
SndFileSource::write_float (Sample* data, framepos_t frame_pos, framecnt_t cnt) SndFileSource::write_float (Sample* data, framepos_t frame_pos, framecnt_t cnt)
{ {
if (_info.format & SF_FORMAT_FLAC) { if ((_info.format & SF_FORMAT_TYPEMASK ) == SF_FORMAT_FLAC) {
assert (_length == frame_pos); assert (_length == frame_pos);
} }
else if (_sndfile == 0 || sf_seek (_sndfile, frame_pos, SEEK_SET|SFM_WRITE) < 0) { else if (_sndfile == 0 || sf_seek (_sndfile, frame_pos, SEEK_SET|SFM_WRITE) < 0) {