<commit_before>#include "timer.h"
#include "orz/exception.h"

namespace Win {
	void Timer::Notify() {
		OnTick();
	}

	void Timer::Create(int delay) {
		if (!Start(delay))
		{
			DO_THROW(Err::CriticalError, "SetTimer Failed");
		}
	}

	void Timer::Destroy() {
		Stop();
	}

	Timer::Timer() {}

	Timer::~Timer() {
		Destroy();
	}
}<commit_msg>Prevent hang when codecs return a frame-delay of 0<commit_after>#include "timer.h"
#include "orz/exception.h"

namespace Win {
	void Timer::Notify() {
		OnTick();
	}

	void Timer::Create(int delay) {
		delay = std::max(1, delay);  // Things pretty much hang if delay=0
		if (!Start(delay))
		{
			DO_THROW(Err::CriticalError, "SetTimer Failed");
		}
	}

	void Timer::Destroy() {
		Stop();
	}

	Timer::Timer() {}

	Timer::~Timer() {
		Destroy();
	}
}
{'fraction_non_alphanumeric': 0.18813131313131312, 'fraction_numerical': 0.003787878787878788, 'mean_word_length': 3.95625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4857457', 'n_tokens_mistral': 333, 'n_tokens_neox': 295, 'n_words': 63}