alpine 3.9
obsolete weakness #560

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

alsa-utils/src/alsa-utils-1.1.8/bat/bat.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.9 obsolete weakness.

 	/* round trip latency test thread */
	if (bat.roundtriplatency) {
		while (1) {
			fprintf(bat.log,
				_("\nStart round trip latency\n"));
			roundtrip_latency_init(&bat);
			test_loopback(&bat);

			if (bat.latency.xrun_error == false)
				break;
			else {
				/* Xrun error in playback or capture,
				increase period size and try again */
				bat.period_size += bat.rate / 1000;
				bat.buffer_size =
					bat.period_size * DIV_BUFFERSIZE;

				/* terminate the test if period_size is
				large enough */
				if (bat.period_size > bat.rate * 0.2)
					break;
			}

			/* Waiting 500ms and start the next round */
			usleep(CAPTURE_DELAY * 1000);
		}
		goto out;
	}

	/* single line playback thread: playback only, no capture */
	if (bat.playback.mode == MODE_SINGLE) {
		test_playback(&bat);
		goto out;
	}

	/* single line capture thread: capture only, no playback */
	if (bat.capture.mode == MODE_SINGLE) {
		test_capture(&bat);
		goto analyze;
	}

	/* loopback thread: playback and capture in a loop */
	if (bat.local == false)
		test_loopback(&bat);

analyze:
#ifdef HAVE_LIBFFTW3F
	if (!bat.standalone || snr_is_valid(bat.snr_thd_db))
		err = analyze_capture(&bat);
#else 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.