Skip to content

Commit

Permalink
Better colorspace error message in 2.5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
tp7 committed Jul 7, 2013
1 parent d91f765 commit 64f431d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion fturn/fturn.cpp
Expand Up @@ -30,6 +30,13 @@ bool isSupportedColorspace(int pixelType) {
return false;
}

const char* getUnsupportedColorspaceMessage() {
#if defined(FILTER_AVS_26)
return "Only YV12, YV24 and Y8 colorspaces are supported.";
#endif
return "Only YV12 colorspace is supported.";
}

bool hasChroma(int pixelType) {
#if defined(FILTER_AVS_26)
return pixelType != VideoInfo::CS_Y8;
Expand Down Expand Up @@ -268,7 +275,7 @@ class FTurn : public GenericVideoFilter {
FTurn::FTurn(PClip child, TurnDirection direction, bool chroma, bool mt, IScriptEnvironment* env)
: GenericVideoFilter(child), chroma_(chroma), mt_(mt), buffer(nullptr), bufferUV(nullptr) {
if (!isSupportedColorspace(vi.pixel_type)) {
env->ThrowError("Only YV12, YV24 and Y8 colorspaces are supported.");
env->ThrowError(getUnsupportedColorspaceMessage());
}

int CPUInfo[4]; //eax, ebx, ecx, edx
Expand Down

0 comments on commit 64f431d

Please sign in to comment.