mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 21:56:30 +01:00
[Summary] Fixed issue with export built on Mavericks. There was not check on empty sets in ExportFormatSpecification class.
C standard, section 6.5.6.8 says: "...if the result points one past the last element of the array object, it shall not be used as the operand of a unary * operator that is evaluated..." So GCC compiler and CLANG compiler (Mavericks) process this operation different way. GCC returns 0 on an attempt to dereference end iterator when CLANG returns a non 0 value.
This commit is contained in:
parent
5877f255f0
commit
f837b66c20
1 changed files with 41 additions and 5 deletions
|
|
@ -114,11 +114,47 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase {
|
|||
std::string format_name () const { return _format_name; }
|
||||
|
||||
Type type () const { return _type; }
|
||||
FormatId format_id () const { return *format_ids.begin(); }
|
||||
Endianness endianness () const { return *endiannesses.begin(); }
|
||||
SampleFormat sample_format () const { return *sample_formats.begin(); }
|
||||
SampleRate sample_rate () const { return *sample_rates.begin(); }
|
||||
Quality quality () const { return *qualities.begin(); }
|
||||
|
||||
FormatId format_id () const
|
||||
{
|
||||
if (!format_ids.empty() )
|
||||
return *format_ids.begin();
|
||||
else
|
||||
return FormatId(0);
|
||||
}
|
||||
|
||||
Endianness endianness () const
|
||||
{
|
||||
if (!endiannesses.empty() )
|
||||
return *endiannesses.begin();
|
||||
else
|
||||
return Endianness(0);
|
||||
}
|
||||
|
||||
SampleFormat sample_format () const
|
||||
{
|
||||
if (!sample_formats.empty() )
|
||||
return *sample_formats.begin();
|
||||
else
|
||||
return SampleFormat(0);
|
||||
}
|
||||
|
||||
SampleRate sample_rate () const
|
||||
{
|
||||
if (!sample_rates.empty() )
|
||||
return *sample_rates.begin();
|
||||
else
|
||||
return SampleRate(0);
|
||||
|
||||
}
|
||||
|
||||
Quality quality () const
|
||||
{
|
||||
if (!qualities.empty() )
|
||||
return *qualities.begin();
|
||||
else
|
||||
return Quality(0);
|
||||
}
|
||||
|
||||
DitherType dither_type () const { return _dither_type; }
|
||||
SRCQuality src_quality () const { return _src_quality; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue