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
357a6d15
Commit
357a6d15
authored
Jan 27, 2004
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Thou shall initialize thou subtitles.
parent
5cd1cfe2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
5 deletions
+36
-5
modules/demux/util/sub.c
modules/demux/util/sub.c
+36
-5
No files found.
modules/demux/util/sub.c
View file @
357a6d15
...
...
@@ -2,7 +2,7 @@
* sub.c: subtitle demux for external subtitle files
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
* $Id: sub.c,v 1.5
0 2004/01/27 22:51:39
hartman Exp $
* $Id: sub.c,v 1.5
1 2004/01/27 23:09:25
hartman Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Derk-Jan Hartman <hartman at videolan dot org>
...
...
@@ -210,7 +210,7 @@ static int sub_SubRipRead ( subtitle_demux_t *p_sub, text_t *txt, subtitle_t *
static
int
sub_SSARead
(
subtitle_demux_t
*
p_sub
,
text_t
*
txt
,
subtitle_t
*
p_subtitle
,
mtime_t
i_microsecperframe
);
static
int
sub_Vplayer
(
subtitle_demux_t
*
p_sub
,
text_t
*
txt
,
subtitle_t
*
p_subtitle
,
mtime_t
i_microsecperframe
);
static
int
sub_Sami
(
subtitle_demux_t
*
p_sub
,
text_t
*
txt
,
subtitle_t
*
p_subtitle
,
mtime_t
i_microsecperframe
);
static
int
sub_VobSub
(
subtitle_demux_t
*
p_sub
,
text_t
*
txt
,
subtitle_t
*
p_subtitle
,
mtime_t
i_microsecperframe
);
static
int
sub_VobSub
IDX
(
subtitle_demux_t
*
p_sub
,
text_t
*
txt
,
subtitle_t
*
p_subtitle
,
mtime_t
i_microsecperframe
);
static
int
DemuxVobSub
(
subtitle_demux_t
*
,
block_t
*
);
...
...
@@ -228,7 +228,7 @@ static struct
{
"ssa2-4"
,
SUB_TYPE_SSA2_4
,
"SSA-2/3/4"
,
sub_SSARead
},
{
"vplayer"
,
SUB_TYPE_VPLAYER
,
"VPlayer"
,
sub_Vplayer
},
{
"sami"
,
SUB_TYPE_SAMI
,
"SAMI"
,
sub_Sami
},
{
"vobsub"
,
SUB_TYPE_VOBSUB
,
"VobSub"
,
sub_VobSub
},
{
"vobsub"
,
SUB_TYPE_VOBSUB
,
"VobSub"
,
sub_VobSub
IDX
},
{
NULL
,
SUB_TYPE_UNKNOWN
,
"Unknown"
,
NULL
}
};
...
...
@@ -730,6 +730,11 @@ static int sub_MicroDvdRead( subtitle_demux_t *p_sub, text_t *txt, subtitle_t *
unsigned
int
i_start
;
unsigned
int
i_stop
;
unsigned
int
i
;
p_subtitle
->
i_start
=
0
;
p_subtitle
->
i_stop
=
0
;
p_subtitle
->
i_vobsub_location
=
0
;
p_subtitle
->
psz_text
=
NULL
;
for
(
;;
)
{
...
...
@@ -778,6 +783,11 @@ static int sub_SubRipRead( subtitle_demux_t *p_sub, text_t *txt, subtitle_t *p_
mtime_t
i_start
;
mtime_t
i_stop
;
p_subtitle
->
i_start
=
0
;
p_subtitle
->
i_stop
=
0
;
p_subtitle
->
i_vobsub_location
=
0
;
p_subtitle
->
psz_text
=
NULL
;
for
(
;;
)
{
int
h1
,
m1
,
s1
,
d1
,
h2
,
m2
,
s2
,
d2
;
...
...
@@ -845,6 +855,11 @@ static int sub_SSARead( subtitle_demux_t *p_sub, text_t *txt, subtitle_t *p_sub
mtime_t
i_start
;
mtime_t
i_stop
;
p_subtitle
->
i_start
=
0
;
p_subtitle
->
i_stop
=
0
;
p_subtitle
->
i_vobsub_location
=
0
;
p_subtitle
->
psz_text
=
NULL
;
for
(
;;
)
{
int
h1
,
m1
,
s1
,
c1
,
h2
,
m2
,
s2
,
c2
;
...
...
@@ -928,6 +943,11 @@ static int sub_Vplayer( subtitle_demux_t *p_sub, text_t *txt, subtitle_t *p_sub
char
buffer_text
[
MAX_LINE
+
1
];
mtime_t
i_start
;
unsigned
int
i
;
p_subtitle
->
i_start
=
0
;
p_subtitle
->
i_stop
=
0
;
p_subtitle
->
i_vobsub_location
=
0
;
p_subtitle
->
psz_text
=
NULL
;
for
(
;;
)
{
...
...
@@ -1004,6 +1024,12 @@ static int sub_Sami( subtitle_demux_t *p_sub, text_t *txt, subtitle_t *p_subtit
int
i_text
;
char
buffer_text
[
10
*
MAX_LINE
+
1
];
p_subtitle
->
i_start
=
0
;
p_subtitle
->
i_stop
=
0
;
p_subtitle
->
i_vobsub_location
=
0
;
p_subtitle
->
psz_text
=
NULL
;
#define ADDC( c ) \
if( i_text < 10*MAX_LINE ) \
{ \
...
...
@@ -1086,7 +1112,7 @@ static int sub_Sami( subtitle_demux_t *p_sub, text_t *txt, subtitle_t *p_subtit
#undef ADDC
}
static
int
sub_VobSub
(
subtitle_demux_t
*
p_sub
,
text_t
*
txt
,
subtitle_t
*
p_subtitle
,
mtime_t
i_microsecperframe
)
static
int
sub_VobSub
IDX
(
subtitle_demux_t
*
p_sub
,
text_t
*
txt
,
subtitle_t
*
p_subtitle
,
mtime_t
i_microsecperframe
)
{
/*
* Parse the idx file. Each line:
...
...
@@ -1095,10 +1121,14 @@ static int sub_VobSub( subtitle_demux_t *p_sub, text_t *txt, subtitle_t *p_subt
*
*/
char
*
p
;
char
buffer_text
[
MAX_LINE
+
1
];
unsigned
int
i_start
,
i_location
;
p_subtitle
->
i_start
=
0
;
p_subtitle
->
i_stop
=
0
;
p_subtitle
->
i_vobsub_location
=
0
;
p_subtitle
->
psz_text
=
NULL
;
for
(
;;
)
{
unsigned
int
h
,
m
,
s
,
ms
,
loc
;
...
...
@@ -1123,6 +1153,7 @@ static int sub_VobSub( subtitle_demux_t *p_sub, text_t *txt, subtitle_t *p_subt
}
p_subtitle
->
i_start
=
(
mtime_t
)
i_start
;
p_subtitle
->
i_stop
=
0
;
p_subtitle
->
psz_text
=
NULL
;
p_subtitle
->
i_vobsub_location
=
i_location
;
fprintf
(
stderr
,
"time: %x, location: %x
\n
"
,
i_start
,
i_location
);
return
(
0
);
...
...
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