Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
1fb78f47
Commit
1fb78f47
authored
Oct 18, 2009
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Subtitles: small fixes and cosmetics
and for counter scopes
parent
a4b3126b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
17 deletions
+15
-17
src/input/subtitles.c
src/input/subtitles.c
+15
-17
No files found.
src/input/subtitles.c
View file @
1fb78f47
/*****************************************************************************
* subtitles.c
* subtitles.c
: subtitles detection
*****************************************************************************
* Copyright (C) 2003-200
6
the VideoLAN team
* Copyright (C) 2003-200
9
the VideoLAN team
* $Id$
*
* Authors: Derk-Jan Hartman <hartman at videolan.org>
...
...
@@ -32,7 +32,6 @@
#endif
#include <vlc_common.h>
#include <vlc_input.h>
#include <vlc_charset.h>
#include <vlc_url.h>
...
...
@@ -40,14 +39,14 @@
# include <dirent.h>
#endif
#include <limits.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/stat.h>
#include <ctype.h>
#include <ctype.h>
/* isalnum */
#include "input_internal.h"
/**
...
...
@@ -55,7 +54,6 @@
*/
#define MAX_SUBTITLE_FILES 128
/**
* The possible extensions for subtitle files we support
*/
...
...
@@ -136,11 +134,11 @@ static int whiteonly( const char *s )
enum
{
SUB_PRIORITY_NONE
=
0
,
SUB_PRIORITY_MATCH_NONE
=
1
,
SUB_PRIORITY_NONE
=
0
,
SUB_PRIORITY_MATCH_NONE
=
1
,
SUB_PRIORITY_MATCH_RIGHT
=
2
,
SUB_PRIORITY_MATCH_LEFT
=
3
,
SUB_PRIORITY_MATCH_ALL
=
4
,
SUB_PRIORITY_MATCH_LEFT
=
3
,
SUB_PRIORITY_MATCH_ALL
=
4
,
};
typedef
struct
{
...
...
@@ -173,13 +171,12 @@ static int compare_sub_priority( const void *a, const void *b )
int
subtitles_Filter
(
const
char
*
psz_dir_content
)
{
const
char
*
tmp
=
strrchr
(
psz_dir_content
,
'.'
);
int
i
;
if
(
!
tmp
)
return
0
;
tmp
++
;
for
(
i
=
0
;
sub_exts
[
i
][
0
];
i
++
)
for
(
i
nt
i
=
0
;
sub_exts
[
i
][
0
];
i
++
)
if
(
strcasecmp
(
sub_exts
[
i
],
tmp
)
==
0
)
return
1
;
return
0
;
...
...
@@ -262,16 +259,18 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
vlc_subfn_t
*
result
=
NULL
;
/* unsorted results */
char
**
result2
;
/* sorted results */
const
char
*
psz_fname
=
psz_name_org
;
if
(
!
psz_fname
)
return
NULL
;
const
char
*
psz_fname
=
decode_URI
(
psz_name_org
);
if
(
!
strncmp
(
psz_fname
,
"file://"
,
7
)
)
{
psz_fname
+=
7
;
if
(
!
strncmp
(
psz_fname
,
"localhost"
,
9
)
)
psz_fname
+=
9
;
}
psz_fname
=
decode_URI
(
psz_fname
);
/* extract filename & dirname from psz_fname */
tmp
=
strrchr
(
psz_fname
,
DIR_SEP_CHAR
);
...
...
@@ -329,7 +328,6 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
const
char
*
psz_dir
=
j
<
0
?
f_dir
:
subdirs
[
j
];
char
**
ppsz_dir_content
;
int
i_dir_content
;
int
a
;
if
(
psz_dir
==
NULL
||
(
j
>=
0
&&
!
strcmp
(
psz_dir
,
f_dir
)
)
)
continue
;
...
...
@@ -341,7 +339,7 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
continue
;
msg_Dbg
(
p_this
,
"looking for a subtitle file in %s"
,
psz_dir
);
for
(
a
=
0
;
a
<
i_dir_content
&&
i_sub_count
<
MAX_SUBTITLE_FILES
;
a
++
)
for
(
int
a
=
0
;
a
<
i_dir_content
&&
i_sub_count
<
MAX_SUBTITLE_FILES
;
a
++
)
{
char
*
psz_name
=
ppsz_dir_content
[
a
];
char
tmp_fname_noext
[
strlen
(
psz_name
)
+
1
];
...
...
@@ -415,7 +413,7 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
}
if
(
ppsz_dir_content
)
{
for
(
a
=
0
;
a
<
i_dir_content
;
a
++
)
for
(
int
a
=
0
;
a
<
i_dir_content
;
a
++
)
free
(
ppsz_dir_content
[
a
]
);
free
(
ppsz_dir_content
);
}
...
...
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