fix subtitle auto-load for when filenames have 2 dots (or more) in file

this fixes T3660
v-0.4.0
Carsten Haitzler 6 years ago
parent 24ac54b72b
commit 88677dfb11
  1. 22
      src/bin/video.c

@ -1021,8 +1021,9 @@ video_file_autosub_set(Evas_Object *obj, const char *file, const char *sub)
int i;
Eina_Bool found = EINA_FALSE;
// try last dont in filename first...
strcpy(sub, file);
p = strchr(sub, '.');
p = strrchr(sub, '.');
if (p)
{
for (i = 0; subtypes[i]; i++)
@ -1036,6 +1037,25 @@ video_file_autosub_set(Evas_Object *obj, const char *file, const char *sub)
}
}
}
// now try first dot as a fallback.
if (!found)
{
strcpy(sub, file);
p = strchr(sub, '.');
if (p)
{
for (i = 0; subtypes[i]; i++)
{
strcpy(p, subtypes[i]);
if (ecore_file_exists(sub))
{
video_sub_file_set(obj, sub);
found = EINA_TRUE;
break;
}
}
}
}
if (!found) video_sub_file_set(obj, NULL);
}
else video_sub_file_set(obj, sub);

Loading…
Cancel
Save