possible fix for stack overflow when parsing video info
[ardour.git] / gtk2_ardour / tempo_lines.cc
index 4f6bd1d9edd2494125a522dda479f94a6fb55093..5d8b7be86a84f9b245b5c7846765cf2748f59f4e 100644 (file)
@@ -72,7 +72,7 @@ TempoLines::draw_ticks (const ARDOUR::TempoMap::BBTPointList::const_iterator& b,
                }
 
                /* draw line with alpha corresponding to coarsest level */
-               const uint8_t    a = max(0, (int)rint(UINT_RGBA_A(base) / (0.75 * log2(level))));
+               const uint8_t    a = max(8, (int)rint(UINT_RGBA_A(base) / (0.8 * log2(level))));
                const uint32_t   c = UINT_RGBA_CHANGE_A(base, a);
                const framepos_t f = b->frame + (l * (fpb / (double)divisions));
                if (f > leftmost_frame) {
@@ -104,7 +104,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
 
        beat_density = (beats * 10.0f) / lines.canvas()->width();
 
-       if (beat_density > 4.0f) {
+       if (beat_density > 2.0f) {
                /* if the lines are too close together, they become useless */
                lines.clear ();
                return;
@@ -117,7 +117,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
 
        lines.clear ();
 
-       if (beat_density < 0.1 && begin != end && begin->frame > 0) {
+       if (beat_density <= 0.12 && begin != end && begin->frame > 0) {
                /* draw subdivisions of the beat before the first visible beat line */
                ARDOUR::TempoMap::BBTPointList::const_iterator prev = begin;
                --prev;
@@ -139,7 +139,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
 
                lines.add (xpos, 1.0, color);
 
-               if (beat_density < 0.1) {
+               if (beat_density <= 0.12) {
                        /* draw subdivisions of this beat */
                        draw_ticks(i, divisions, leftmost_frame, frame_rate);
                }