Am 06.01.2008 um 14:57 schrieb Stuart Brady:

On Sat, Jan 05, 2008 at 08:22:33PM -0600, Carlo Marcelo Arenas Belon wrote:

the exact number of sectors is really not that relevant, as the whole point here is to try to detect if it is a CD (700MB) or a DVD (4.7GB) and the logic is just assuming that if it has more sectors than you should normally expect
in a CD, then it is a DVD.

My answer was quite relevant to Rob's question, which was "Where does
the constant come from, anyway?"

As for the code, there's a choice between using an incorrect value, and
correctly detecting for the vast majority of cases, and using the
correct value and correctly detecting for 100% of cases. Perhaps "only
marginally broken" is "good enough", seeing as nobody's complained.

Either way, shouldn't it be a preprocessor define rather than a magic number, maybe something like MAX_SECTORS_CD? Then it can more easily be found and changed, where necessary.


Reply via email to