Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
f5a83db0
Commit
f5a83db0
authored
Oct 06, 2004
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* if a .idx vobsub is found, then don't autodetect the corresponding .sub file
parent
e2197980
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
3 deletions
+26
-3
src/input/subtitles.c
src/input/subtitles.c
+26
-3
No files found.
src/input/subtitles.c
View file @
f5a83db0
...
...
@@ -131,6 +131,7 @@ typedef struct _subfn
{
int
priority
;
char
*
psz_fname
;
char
*
psz_ext
;
}
subfn
;
static
int
compare_sub_priority
(
const
void
*
a
,
const
void
*
b
)
...
...
@@ -239,7 +240,7 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
/* variables to be used for derivatives FILE *f */
char
*
tmp_fname_noext
,
*
tmp_fname_trim
,
*
tmp_fname_ext
,
*
tmpresult
;
vlc_value_t
fuzzy
;
int
len
,
i
,
j
,
i_sub_count
;
int
len
,
i
,
j
,
i_sub_count
,
i_result2
;
subfn
*
result
;
/* unsorted results */
char
**
result2
;
/* sorted results */
char
**
tmp_subdirs
,
**
subdirs
;
/* list of subdirectories to look in */
...
...
@@ -367,6 +368,7 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
fclose
(
f
);
result
[
i_sub_count
].
priority
=
i_prio
;
result
[
i_sub_count
].
psz_fname
=
strdup
(
tmpresult
);
result
[
i_sub_count
].
psz_ext
=
strdup
(
tmp_fname_ext
);
i_sub_count
++
;
}
}
...
...
@@ -395,12 +397,33 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
result2
=
(
char
**
)
malloc
(
sizeof
(
char
*
)
*
(
i_sub_count
+
1
)
);
memset
(
result2
,
0
,
sizeof
(
char
*
)
*
(
i_sub_count
+
1
)
);
i_result2
=
0
;
for
(
i
=
0
;
i
<
i_sub_count
;
i
++
)
{
result2
[
i
]
=
result
[
i
].
psz_fname
;
if
(
result
[
i
].
psz_ext
&&
!
strcasecmp
(
result
[
i
].
psz_ext
,
"sub"
)
)
{
int
j
;
for
(
j
=
0
;
j
<
i_sub_count
;
j
++
)
{
if
(
result
[
j
].
psz_fname
&&
result
[
i
].
psz_fname
&&
!
strncasecmp
(
result
[
i
].
psz_fname
,
result
[
j
].
psz_fname
,
sizeof
(
result
[
i
].
psz_fname
)
-
4
)
)
break
;
}
if
(
j
>=
i_sub_count
)
{
result2
[
i_result2
]
=
result
[
i
].
psz_fname
;
i_result2
++
;
}
}
else
{
result2
[
i_result2
]
=
result
[
i
].
psz_fname
;
i_result2
++
;
}
}
result2
[
i_
sub_count
]
=
NULL
;
result2
[
i_
result2
+
1
]
=
NULL
;
free
(
result
);
return
result2
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment