Skip to content

Commit

Permalink
Fix building on current master as well
Browse files Browse the repository at this point in the history
  • Loading branch information
EIREXE committed Apr 18, 2024
1 parent a8837b7 commit 515eb03
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
27 changes: 15 additions & 12 deletions gdextension_build/ffmpeg_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ def get_download_url(env):


def download_ffmpeg(target, source, env):
dst = os.path.dirname(target[0].get_path())
dst = ""
if isinstance(target[0], str):
dst = os.path.dirname(target[0])
else:
dst = os.path.dirname(target[0].get_path())
if os.path.exists(dst):
shutil.rmtree(dst)

Expand All @@ -63,17 +67,16 @@ def rewrite_subfolder_paths(tf, common_path):


def _ffmpeg_emitter(target, source, env):
target += get_ffmpeg_install_sources(env, os.path.dirname(target[0].get_path()))
dst = ""
if isinstance(target[0], str):
dst = os.path.dirname(target[0])
else:
dst = os.path.dirname(target[0].get_path())
target += get_ffmpeg_install_sources(env, dst)
if env["platform"] == "windows":
target += [
os.path.join(os.path.dirname(target[0].get_path()), f"lib/{lib}.lib")
for lib, version in ffmpeg_versions.items()
]
target += [os.path.join(dst, f"lib/{lib}.lib") for lib, version in ffmpeg_versions.items()]
else:
target += [
os.path.join(os.path.dirname(target[0].get_path()), f"lib/lib{lib}.so")
for lib, version in ffmpeg_versions.items()
]
target += [os.path.join(dst, f"lib/lib{lib}.so") for lib, version in ffmpeg_versions.items()]

emitter_headers = [
"libavcodec/codec.h",
Expand All @@ -85,14 +88,14 @@ def _ffmpeg_emitter(target, source, env):
"libswscale/swscale.h",
]

target += [os.path.join(os.path.dirname(target[0].get_path()), "include/" + x) for x in emitter_headers]
target += [os.path.join(dst, "include/" + x) for x in emitter_headers]

return target, source


def ffmpeg_download_builder(env, target, source):
bkw = {
"action": env.Run(download_ffmpeg, subprocess=False),
"action": env.Run(download_ffmpeg),
"target_factory": env.fs.Entry,
"source_factory": env.fs.Entry,
"emitter": _ffmpeg_emitter,
Expand Down
3 changes: 1 addition & 2 deletions video_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,7 @@ int VideoDecoder::get_audio_channel_count() const {
return 0;
}

VideoDecoder::VideoDecoder(Ref<FileAccess> p_file) :
decoder_commands(true) {
VideoDecoder::VideoDecoder(Ref<FileAccess> p_file) {
video_file = p_file;
}

Expand Down

0 comments on commit 515eb03

Please sign in to comment.