Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
361dab55
Commit
361dab55
authored
Jan 26, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/demux/util/*: a bit of cleanup.
parent
48697854
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
34 deletions
+21
-34
modules/demux/util/sub.c
modules/demux/util/sub.c
+14
-24
modules/demux/util/sub.h
modules/demux/util/sub.h
+2
-5
src/input/input.c
src/input/input.c
+5
-5
No files found.
modules/demux/util/sub.c
View file @
361dab55
...
...
@@ -2,7 +2,7 @@
* sub.c
*****************************************************************************
* Copyright (C) 1999-2003 VideoLAN
* $Id: sub.c,v 1.4
1 2004/01/25 20:05:29 hartma
n Exp $
* $Id: sub.c,v 1.4
2 2004/01/26 20:02:15 gbazi
n Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -157,7 +157,6 @@ static int text_load( text_t *txt, char *psz_name )
i_line_max
+=
100
;
txt
->
line
=
realloc
(
txt
->
line
,
i_line_max
*
sizeof
(
char
*
)
);
}
printf
(
"hoi, %s"
,
txt
->
line
);
}
fclose
(
f
);
...
...
@@ -256,21 +255,16 @@ static char * local_stristr( char *psz_big, char *psz_little)
/*****************************************************************************
* sub_open: Open a subtitle file and add subtitle ES
*****************************************************************************/
static
int
sub_open
(
subtitle_demux_t
*
p_sub
,
input_thread_t
*
p_input
,
char
*
psz_name
,
mtime_t
i_microsecperframe
,
int
i_track_id
)
static
int
sub_open
(
subtitle_demux_t
*
p_sub
,
input_thread_t
*
p_input
,
char
*
psz_name
,
mtime_t
i_microsecperframe
,
int
i_track_id
)
{
text_t
txt
;
vlc_value_t
val
;
es_format_t
fmt
;
char
*
psz_vobname
;
int
i
;
int
i_sub_type
;
int
i_max
;
int
(
*
pf_read_subtitle
)(
subtitle_demux_t
*
,
text_t
*
,
subtitle_t
*
,
mtime_t
)
=
NULL
;
es_format_t
fmt
;
int
i
,
i_sub_type
,
i_max
;
int
(
*
pf_read_subtitle
)(
subtitle_demux_t
*
,
text_t
*
,
subtitle_t
*
,
mtime_t
)
=
NULL
;
p_sub
->
i_sub_type
=
SUB_TYPE_UNKNOWN
;
p_sub
->
p_es
=
NULL
;
...
...
@@ -281,7 +275,6 @@ static int sub_open ( subtitle_demux_t *p_sub,
if
(
!
psz_name
||
!*
psz_name
)
{
msg_Err
(
p_sub
,
"no subtitle file specified"
);
if
(
psz_name
)
free
(
psz_name
);
return
VLC_EGENERIC
;
}
...
...
@@ -289,13 +282,10 @@ static int sub_open ( subtitle_demux_t *p_sub,
if
(
text_load
(
&
txt
,
psz_name
)
)
{
msg_Err
(
p_sub
,
"cannot open `%s' subtitle file"
,
psz_name
);
free
(
psz_name
);
return
VLC_EGENERIC
;
}
msg_Dbg
(
p_sub
,
"opened `%s'"
,
psz_name
);
psz_vobname
=
strdup
(
psz_name
);
free
(
psz_name
);
var_Get
(
p_sub
,
"sub-fps"
,
&
val
);
if
(
val
.
i_int
>=
1
.
0
)
...
...
@@ -474,17 +464,17 @@ static int sub_open ( subtitle_demux_t *p_sub,
/* *** add subtitle ES *** */
if
(
p_sub
->
i_sub_type
==
SUB_TYPE_VOBSUB
)
{
int
i_len
=
strlen
(
psz_
vob
name
);
char
*
extension
=
psz_vobname
+
i_len
-
4
;
strcpy
(
extension
,
".sub"
);
int
i_len
=
strlen
(
psz_name
);
char
*
psz_vobname
=
strdup
(
psz_name
)
;
strcpy
(
psz_vobname
+
i_len
-
4
,
".sub"
);
/* open file */
if
(
!
(
p_sub
->
p_vobsub_file
=
fopen
(
psz_vobname
,
"rb"
)
)
)
{
msg_Err
(
p_sub
,
"couldn't open .sub Vobsub file: %s"
,
psz_vobname
);
}
if
(
psz_vobname
)
free
(
psz_vobname
);
free
(
psz_vobname
);
es_format_Init
(
&
fmt
,
SPU_ES
,
VLC_FOURCC
(
's'
,
'p'
,
'u'
,
' '
)
);
}
...
...
modules/demux/util/sub.h
View file @
361dab55
...
...
@@ -2,7 +2,7 @@
* sub.h
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: sub.h,v 1.1
2 2004/01/25 20:05:29 hartma
n Exp $
* $Id: sub.h,v 1.1
3 2004/01/26 20:02:15 gbazi
n Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -114,10 +114,7 @@ static inline subtitle_demux_t *subtitle_New( input_thread_t *p_input,
p_sub
->
p_module
=
module_Need
(
p_sub
,
"subtitle demux"
,
""
);
if
(
p_sub
->
p_module
&&
p_sub
->
pf_open
(
p_sub
,
p_input
,
psz_name
,
i_microsecperframe
,
p_sub
->
pf_open
(
p_sub
,
p_input
,
psz_name
,
i_microsecperframe
,
i_track_id
)
>=
0
)
{
msg_Info
(
p_input
,
"subtitle started"
);
...
...
src/input/input.c
View file @
361dab55
...
...
@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998-2004 VideoLAN
* $Id: input.c,v 1.27
7 2004/01/25 17:16:05 zorglub
Exp $
* $Id: input.c,v 1.27
8 2004/01/26 20:02:15 gbazin
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -101,11 +101,11 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent,
{
if
(
!
strncmp
(
p_item
->
pp_categories
[
i
]
->
psz_name
,
_
(
"Options"
),
7
)
)
{
msg_Dbg
(
p_input
,
"Parsing %i options for item"
,
p_item
->
pp_categories
[
i
]
->
i_infos
);
msg_Dbg
(
p_input
,
"Parsing %i options for item"
,
p_item
->
pp_categories
[
i
]
->
i_infos
);
for
(
j
=
0
;
j
<
p_item
->
pp_categories
[
i
]
->
i_infos
;
j
++
)
{
msg_Dbg
(
p_input
,
"Option : %s"
,
msg_Dbg
(
p_input
,
"Option : %s"
,
p_item
->
pp_categories
[
i
]
->
pp_infos
[
j
]
->
psz_name
);
ParseOption
(
p_input
,
p_item
->
pp_categories
[
i
]
->
pp_infos
[
j
]
->
psz_value
);
...
...
@@ -837,7 +837,7 @@ static int InitThread( input_thread_t * p_input )
char
**
tmp2
=
tmp
;
for
(
i
=
0
;
*
tmp2
!=
NULL
;
i
++
)
{
if
(
(
p_sub
=
subtitle_New
(
p_input
,
strdup
(
*
tmp2
++
)
,
if
(
(
p_sub
=
subtitle_New
(
p_input
,
*
tmp2
++
,
i_microsecondperframe
,
i
)
)
)
{
TAB_APPEND
(
p_input
->
p_sys
->
i_sub
,
p_input
->
p_sys
->
sub
,
p_sub
);
...
...
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