Skip to content

Commit

Permalink
Fix compilation for freeimage
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiohs84 committed Nov 11, 2020
1 parent c70093d commit 744a735
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/gfx/freeimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,9 @@ bool GfxProcFreeImage::readbitmapFfmpeg(FileAccess* fa, string* imagePath, int s
seek_target = av_rescale_q(formatContext->duration / 5, av_get_time_base_q(), videoStream->time_base);
}

char ext[MAXEXTENSIONLEN];

if (client->fsaccess->getextension(LocalPath::fromLocalname(*imagePath),ext,8)
&& strcmp(ext,".mp3") && seek_target > 0
string extension;
if (client->fsaccess->getextension(LocalPath::fromLocalname(*imagePath), extension)
&& extension.compare(".mp3") && seek_target > 0
&& av_seek_frame(formatContext, videoStreamIdx, seek_target, AVSEEK_FLAG_BACKWARD) < 0)
{
LOG_warn << "Error seeking video";
Expand Down Expand Up @@ -405,12 +404,12 @@ bool GfxProcFreeImage::readbitmap(FileAccess* fa, string* localname, int size)
#endif

#ifdef HAVE_FFMPEG
char ext[MAXEXTENSIONLEN];
string extension;
bool isvideo = false;
if (client->fsaccess->getextension(LocalPath::fromLocalname(*localname), ext, sizeof ext))
if (client->fsaccess->getextension(LocalPath::fromLocalname(*localname), extension))
{
const char* ptr;
if ((ptr = strstr(supportedformatsFfmpeg(), ext)) && ptr[strlen(ext)] == '.')
if ((ptr = strstr(supportedformatsFfmpeg(), extension.c_str())) && ptr[extension.size()] == '.')
{
string name; // WIN32 ffmpeg uses utf8 rather than wide strings
client->fsaccess->local2path(localname, &name);
Expand Down

0 comments on commit 744a735

Please sign in to comment.