Skip to content

Commit

Permalink
AviSynth: allow format="" (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asd-g committed Dec 24, 2023
1 parent d365e8b commit 6c2a19a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions AviSynth/libavsmash_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,13 @@ AVSValue __cdecl CreateLSMASHVideoSource( AVSValue args, void *user_data, IScrip
enum AVPixelFormat pixel_format = AV_PIX_FMT_NONE;
if (args[8].Defined())
{
pixel_format = get_av_output_pixel_format(args[8].AsString(nullptr));
if (pixel_format == AV_PIX_FMT_NONE)
env->ThrowError("LSMASHVideoSource: wrong format.");
const char* pix_fmt = args[8].AsString();
if (strcmp(pix_fmt, ""))
{
pixel_format = get_av_output_pixel_format(pix_fmt);
if (pixel_format == AV_PIX_FMT_NONE)
env->ThrowError("LSMASHVideoSource: wrong format.");
}
}
const char *preferred_decoder_names = args[9].AsString( nullptr );
int prefer_hw_decoder = args[10].AsInt( 0 );
Expand Down
10 changes: 7 additions & 3 deletions AviSynth/lwlibav_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,13 @@ AVSValue __cdecl CreateLWLibavVideoSource( AVSValue args, void *user_data, IScri
enum AVPixelFormat pixel_format = AV_PIX_FMT_NONE;
if (args[12].Defined())
{
pixel_format = get_av_output_pixel_format(args[12].AsString());
if (pixel_format == AV_PIX_FMT_NONE)
env->ThrowError("LWLibavVideoSource: wrong format.");
const char* pix_fmt = args[12].AsString();
if (strcmp(pix_fmt, ""))
{
pixel_format = get_av_output_pixel_format(pix_fmt);
if (pixel_format == AV_PIX_FMT_NONE)
env->ThrowError("LWLibavVideoSource: wrong format.");
}
}
const char *preferred_decoder_names = args[13].AsString( nullptr );
int prefer_hw_decoder = args[14].AsInt( 0 );
Expand Down

0 comments on commit 6c2a19a

Please sign in to comment.