fedora 24
obsolete weakness #287

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:

Ardour-5.10.0/gtk2_ardour/video_image_frame.cc

Context:

The highlighted line of code below is the trigger point of this particular Fedora 24 obsolete weakness.

 		http_get_again(want_video_frame_number);
		return;
	}

	if (!data) {
		/* Image request failed (HTTP error or timeout) */
		img = image->get_image();
		fill_frame(128, 0, 0);
		draw_x();
		cut_rightend();
		draw_line();
		cut_rightend();
		image->put_image(img);
	} else {
		img = image->get_image(false);
		img->data = (uint8_t*) data;
		img->destroy_callback = &freedata_cb;
		draw_line();
		cut_rightend();
		image->put_image(img);
	}

	exposeimg();
	/* don't request frames too quickly, wait after user has zoomed */
	Glib::usleep(40000);

	if (queued_request) {
		http_get_again(want_video_frame_number);
	}
	pthread_mutex_unlock(&request_lock);
}


void
VideoImageFrame::http_get(framepos_t fn) {
	if (pthread_mutex_trylock(&request_lock)) {
		pthread_mutex_lock(&queue_lock);
		queued_request=true;
		want_video_frame_number=fn;
		pthread_mutex_unlock(&queue_lock);
		return;
	}
	if (thread_active) pthread_join(thread_id_tt, NULL);
	pthread_mutex_lock(&queue_lock);
	queued_request=false;
	req_video_frame_number=fn;
	pthread_mutex_unlock(&queue_lock);
	int rv = pthread_create(&thread_id_tt, NULL, http_get_thread, this);
	thread_active=true;
	if (rv) { 

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.