Merge branch 'master' into clangen/upstream-pdcurses

This commit is contained in:
casey langen 2020-03-01 18:51:58 -08:00
commit 64ef948347
3 changed files with 20 additions and 12 deletions

View File

@ -59,6 +59,14 @@ static std::shared_ptr<INavigationKeys> keys;
#define ENABLE_BOUNDS_CHECK 1
/* clangen says: we used to just be able to call wbkgd() prior to ncurses 6.2;
however, something changed internally that causes the drawing to get corrupted
if we don't call wbkgdset() first. this looks like a bug, and the release notes
mention wbkgd() was changed, but it's unclear what exactly happened... */
#define wbkgd_internal(window, color) \
wbkgdset(window, color); \
wbkgd(window, color);
static inline void DrawCursor(IInput* input) {
if (input) {
Window* inputWindow = dynamic_cast<Window*>(input);
@ -449,13 +457,13 @@ void Window::RepaintBackground() {
this->content != this->frame)
{
werase(this->frame);
wbkgd(this->frame, focused? this->focusedFrameColor : this->frameColor);
wbkgd_internal(this->frame, focused? this->focusedFrameColor : this->frameColor);
this->DrawFrameAndTitle();
}
if (this->content) {
werase(this->content);
wbkgd(this->content, focused ? this->focusedContentColor : this->contentColor);
wbkgd_internal(this->content, focused ? this->focusedContentColor : this->contentColor);
}
this->Invalidate();
@ -777,11 +785,11 @@ void Window::Clear() {
int64_t frameColor = focused ? this->focusedFrameColor : this->frameColor;
if (this->content == this->frame && this->frame) {
wbkgd(this->frame, contentColor);
wbkgd_internal(this->frame, contentColor);
}
else if (this->frame && this->content) {
wbkgd(this->frame, frameColor);
wbkgd(this->content, contentColor);
else if (this->frame && this->context) {
wbkgd_internal(this->frame, frameColor);
wbkgd_internal(this->frame, contentColor);
}
}
@ -881,4 +889,4 @@ INavigationKeys& Window::NavigationKeys() {
}
return defaultNavigationKeys;
}
}

View File

@ -275,14 +275,14 @@ IDataStream* Transcoder::TranscodeAndWait(
else {
IBlockingEncoder* blockingEncoder = dynamic_cast<IBlockingEncoder*>(encoder);
if (blockingEncoder) {
bool waitForExisting = false;
bool alreadyTranscoding = false;
{
/* see if there's already a blocking transcoder running for the specified
uri. if there is, wait for it to complete. if there's not, add it to the
running set */
std::unique_lock<std::mutex> lock(transcoderMutex);
waitForExisting = runningBlockingTranscoders.find(uri) != runningBlockingTranscoders.end();
if (waitForExisting) {
alreadyTranscoding = runningBlockingTranscoders.find(uri) != runningBlockingTranscoders.end();
if (alreadyTranscoding) {
while (runningBlockingTranscoders.find(uri) != runningBlockingTranscoders.end()) {
waitForTranscode.wait(lock);
}
@ -292,7 +292,7 @@ IDataStream* Transcoder::TranscodeAndWait(
}
}
if (!waitForExisting) {
if (!alreadyTranscoding) {
BlockingTranscoder blockingTranscoder(
context, blockingEncoder, uri, tempFilename, expectedFilename, bitrate);

View File

@ -64,6 +64,7 @@ class Transcoder {
size_t bitrate,
const std::string& format);
private:
static IDataStream* TranscodeOnDemand(
Context& context,
IStreamingEncoder* encoder,
@ -71,7 +72,6 @@ class Transcoder {
size_t bitrate,
const std::string& format);
private:
Transcoder() { }
~Transcoder() { }
};