Skip to content

Commit

Permalink
Fix delay load for FFmpeg.
Browse files Browse the repository at this point in the history
Prioritize FFmpeg from OBS.
  • Loading branch information
cqjjjzr committed Nov 29, 2022
1 parent 191ea53 commit 3594f06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion media-playback/media.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ bool mp_media_init(mp_media_t *media, const struct mp_media_info *info)
media->buffering = info->buffering;
media->speed = info->speed;
media->is_local_file = info->is_local_file;
media->read_buffer = reinterpret_cast<unsigned char*>(av_malloc(READ_BUFFER_SIZE));
media->read_buffer = static_cast<unsigned char*>(av_malloc(READ_BUFFER_SIZE));
da_init(media->packet_pool);

if (!info->is_local_file || media->speed < 1 || media->speed > 200)
Expand Down
7 changes: 6 additions & 1 deletion streamlink-delayload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ FARPROC WINAPI obs_streamlink_delay_load(unsigned dliNotify, PDelayLoadInfo pdli
auto pathFFmpeg = obs_streamlink_data_path / "ffmpeg" / pdli->szDll;
auto pathPython = obs_streamlink_data_path / obs_streamlink_python_ver / pdli->szDll;
if (exists(pathFFmpeg))
return reinterpret_cast<FARPROC>(LoadLibraryW(pathFFmpeg.wstring().c_str()));
{
auto directLoad = LoadLibraryA(pdli->szDll);
if (!directLoad)
return reinterpret_cast<FARPROC>(LoadLibraryW(pathFFmpeg.wstring().c_str()));
return reinterpret_cast<FARPROC>(directLoad);
}
if (exists(pathPython))
return reinterpret_cast<FARPROC>(LoadLibraryW(pathPython.wstring().c_str()));
}
Expand Down

0 comments on commit 3594f06

Please sign in to comment.