Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
49faf2e1
Commit
49faf2e1
authored
Aug 24, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* sub.c : fixed a warning.
parent
4a8900b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
modules/demux/util/sub.c
modules/demux/util/sub.c
+12
-12
No files found.
modules/demux/util/sub.c
View file @
49faf2e1
...
...
@@ -2,7 +2,7 @@
* sub.c
*****************************************************************************
* Copyright (C) 1999-2003 VideoLAN
* $Id: sub.c,v 1.2
2 2003/08/23 22:02:45 hartman
Exp $
* $Id: sub.c,v 1.2
3 2003/08/24 00:36:38 fenrir
Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -243,7 +243,8 @@ char* sub_detect( subtitle_demux_t *p_sub, char *psz_filename)
DIR
*
p_dir_handle
;
struct
dirent
*
p_dir_afile
;
char
*
ppsz_sub_exts
[]
=
{
"sub"
,
"srt"
,
"smi"
,
"ssa"
,
NULL
};
char
*
psz_result
,
*
psz_basename
,
*
psz_dir
,
*
psz_file_noext
,
*
psz_extension
;
char
*
psz_result
,
*
psz_basename
,
*
psz_dir
=
NULL
;
char
*
psz_file_noext
,
*
psz_extension
;
int
i
;
size_t
i_dirlen
=
0
;
...
...
@@ -264,20 +265,20 @@ char* sub_detect( subtitle_demux_t *p_sub, char *psz_filename)
return
""
;
}
strncpy
(
psz_dir
,
psz_filename
,
i_dirlen
);
psz_dir
[
i_dirlen
]
=
'\0'
;
psz_dir
[
i_dirlen
]
=
'\0'
;
++
psz_basename
;
}
else
{
psz_basename
=
psz_filename
;
}
psz_extension
=
strrchr
(
psz_basename
,
'.'
);
if
(
psz_extension
)
{
size_t
i_baselen
=
(
1
+
psz_extension
)
-
psz_basename
;
psz_file_noext
=
(
char
*
)
malloc
(
i_baselen
+
1
);
if
(
!
psz_file_noext
)
{
...
...
@@ -288,14 +289,14 @@ char* sub_detect( subtitle_demux_t *p_sub, char *psz_filename)
++
psz_extension
;
}
else
return
""
;
p_dir_handle
=
opendir
(
psz_dir
);
if
(
p_dir_handle
)
{
p_dir_handle
=
opendir
(
psz_dir
?
psz_dir
:
""
);
if
(
p_dir_handle
)
{
int
i_found
=
0
;
while
((
p_dir_afile
=
readdir
(
p_dir_handle
)))
{
while
((
p_dir_afile
=
readdir
(
p_dir_handle
)))
{
char
*
psz_afile_ext
=
strrchr
(
p_dir_afile
->
d_name
,
'.'
);
if
(
psz_afile_ext
)
{
++
psz_afile_ext
;
...
...
@@ -323,7 +324,6 @@ char* sub_detect( subtitle_demux_t *p_sub, char *psz_filename)
}
closedir
(
p_dir_handle
);
}
}
return
""
;
}
...
...
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