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
62f7a588
Commit
62f7a588
authored
Oct 28, 2004
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* subtitle.c: make sure int -> date conversion is don properly everywhere.
parent
14aee4fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
46 deletions
+46
-46
modules/demux/subtitle.c
modules/demux/subtitle.c
+46
-46
No files found.
modules/demux/subtitle.c
View file @
62f7a588
...
...
@@ -105,8 +105,8 @@ static void TextUnload( text_t * );
typedef
struct
{
mtime
_t
i_start
;
mtime
_t
i_stop
;
int64
_t
i_start
;
int64
_t
i_stop
;
char
*
psz_text
;
}
subtitle_t
;
...
...
@@ -121,7 +121,7 @@ struct demux_sys_t
int64_t
i_next_demux_date
;
int64_t
i_microsecperframe
;
mtime
_t
i_original_mspf
;
int64
_t
i_original_mspf
;
char
*
psz_header
;
int
i_subtitle
;
...
...
@@ -194,13 +194,13 @@ static int Open ( vlc_object_t *p_this )
f_fps
=
var_CreateGetFloat
(
p_demux
,
"sub-fps"
);
if
(
f_fps
>=
1
.
0
)
{
p_sys
->
i_microsecperframe
=
(
mtime
_t
)(
(
float
)
1000000
/
f_fps
);
p_sys
->
i_microsecperframe
=
(
int64
_t
)(
(
float
)
1000000
/
f_fps
);
}
f_fps
=
var_CreateGetFloat
(
p_demux
,
"sub-original-fps"
);
if
(
f_fps
>=
1
.
0
)
{
p_sys
->
i_original_mspf
=
(
mtime
_t
)(
(
float
)
1000000
/
f_fps
);
p_sys
->
i_original_mspf
=
(
int64
_t
)(
(
float
)
1000000
/
f_fps
);
}
else
{
...
...
@@ -676,8 +676,8 @@ static int ParseMicroDvd( demux_t *p_demux, subtitle_t *p_subtitle )
char
*
s
;
char
buffer_text
[
MAX_LINE
+
1
];
unsigned
int
i_start
;
unsigned
int
i_stop
;
int
i_start
;
int
i_stop
;
unsigned
int
i
;
p_subtitle
->
i_start
=
0
;
...
...
@@ -709,8 +709,8 @@ static int ParseMicroDvd( demux_t *p_demux, subtitle_t *p_subtitle )
}
}
p_subtitle
->
i_start
=
(
mtime
_t
)
i_start
*
p_sys
->
i_microsecperframe
;
p_subtitle
->
i_stop
=
(
mtime
_t
)
i_stop
*
p_sys
->
i_microsecperframe
;
p_subtitle
->
i_start
=
(
int64
_t
)
i_start
*
p_sys
->
i_microsecperframe
;
p_subtitle
->
i_stop
=
(
int64
_t
)
i_stop
*
p_sys
->
i_microsecperframe
;
p_subtitle
->
psz_text
=
strndup
(
buffer_text
,
MAX_LINE
);
return
(
0
);
}
...
...
@@ -732,8 +732,8 @@ static int ParseSubRip( demux_t *p_demux, subtitle_t *p_subtitle )
char
*
s
;
char
buffer_text
[
10
*
MAX_LINE
];
int
i_buffer_text
;
mtime
_t
i_start
;
mtime
_t
i_stop
;
int64
_t
i_start
;
int64
_t
i_stop
;
p_subtitle
->
i_start
=
0
;
p_subtitle
->
i_stop
=
0
;
...
...
@@ -751,15 +751,15 @@ static int ParseSubRip( demux_t *p_demux, subtitle_t *p_subtitle )
&
h1
,
&
m1
,
&
s1
,
&
d1
,
&
h2
,
&
m2
,
&
s2
,
&
d2
)
==
8
)
{
i_start
=
(
(
mtime
_t
)
h1
*
3600
*
1000
+
(
mtime
_t
)
m1
*
60
*
1000
+
(
mtime
_t
)
s1
*
1000
+
(
mtime
_t
)
d1
)
*
1000
;
i_start
=
(
(
int64
_t
)
h1
*
3600
*
1000
+
(
int64
_t
)
m1
*
60
*
1000
+
(
int64
_t
)
s1
*
1000
+
(
int64
_t
)
d1
)
*
1000
;
i_stop
=
(
(
mtime
_t
)
h2
*
3600
*
1000
+
(
mtime
_t
)
m2
*
60
*
1000
+
(
mtime
_t
)
s2
*
1000
+
(
mtime
_t
)
d2
)
*
1000
;
i_stop
=
(
(
int64
_t
)
h2
*
3600
*
1000
+
(
int64
_t
)
m2
*
60
*
1000
+
(
int64
_t
)
s2
*
1000
+
(
int64
_t
)
d2
)
*
1000
;
/* Now read text until an empty line */
for
(
i_buffer_text
=
0
;;
)
...
...
@@ -782,10 +782,10 @@ static int ParseSubRip( demux_t *p_demux, subtitle_t *p_subtitle )
if
(
p_sys
->
i_microsecperframe
!=
0
&&
p_sys
->
i_original_mspf
!=
0
)
{
p_subtitle
->
i_start
=
(
mtime
_t
)
i_start
*
p_subtitle
->
i_start
=
(
int64
_t
)
i_start
*
p_sys
->
i_microsecperframe
/
p_sys
->
i_original_mspf
;
p_subtitle
->
i_stop
=
(
mtime
_t
)
i_stop
*
p_subtitle
->
i_stop
=
(
int64
_t
)
i_stop
*
p_sys
->
i_microsecperframe
/
p_sys
->
i_original_mspf
;
}
...
...
@@ -825,8 +825,8 @@ static int ParseSubViewer( demux_t *p_demux, subtitle_t *p_subtitle )
char
*
s
;
char
buffer_text
[
10
*
MAX_LINE
];
int
i_buffer_text
;
mtime
_t
i_start
;
mtime
_t
i_stop
;
int64
_t
i_start
;
int64
_t
i_stop
;
p_subtitle
->
i_start
=
0
;
p_subtitle
->
i_stop
=
0
;
...
...
@@ -844,15 +844,15 @@ static int ParseSubViewer( demux_t *p_demux, subtitle_t *p_subtitle )
&
h1
,
&
m1
,
&
s1
,
&
d1
,
&
h2
,
&
m2
,
&
s2
,
&
d2
)
==
8
)
{
i_start
=
(
(
mtime
_t
)
h1
*
3600
*
1000
+
(
mtime
_t
)
m1
*
60
*
1000
+
(
mtime
_t
)
s1
*
1000
+
(
mtime
_t
)
d1
)
*
1000
;
i_start
=
(
(
int64
_t
)
h1
*
3600
*
1000
+
(
int64
_t
)
m1
*
60
*
1000
+
(
int64
_t
)
s1
*
1000
+
(
int64
_t
)
d1
)
*
1000
;
i_stop
=
(
(
mtime
_t
)
h2
*
3600
*
1000
+
(
mtime
_t
)
m2
*
60
*
1000
+
(
mtime
_t
)
s2
*
1000
+
(
mtime
_t
)
d2
)
*
1000
;
i_stop
=
(
(
int64
_t
)
h2
*
3600
*
1000
+
(
int64
_t
)
m2
*
60
*
1000
+
(
int64
_t
)
s2
*
1000
+
(
int64
_t
)
d2
)
*
1000
;
/* Now read text until an empty line */
for
(
i_buffer_text
=
0
;;
)
...
...
@@ -912,8 +912,8 @@ static int ParseSSA( demux_t *p_demux, subtitle_t *p_subtitle )
char
buffer_text
[
10
*
MAX_LINE
];
char
*
s
;
mtime
_t
i_start
;
mtime
_t
i_stop
;
int64
_t
i_start
;
int64
_t
i_stop
;
p_subtitle
->
i_start
=
0
;
p_subtitle
->
i_stop
=
0
;
...
...
@@ -937,15 +937,15 @@ static int ParseSSA( demux_t *p_demux, subtitle_t *p_subtitle )
&
h2
,
&
m2
,
&
s2
,
&
c2
,
buffer_text
)
==
10
)
{
i_start
=
(
(
mtime
_t
)
h1
*
3600
*
1000
+
(
mtime
_t
)
m1
*
60
*
1000
+
(
mtime
_t
)
s1
*
1000
+
(
mtime
_t
)
c1
*
10
)
*
1000
;
i_start
=
(
(
int64
_t
)
h1
*
3600
*
1000
+
(
int64
_t
)
m1
*
60
*
1000
+
(
int64
_t
)
s1
*
1000
+
(
int64
_t
)
c1
*
10
)
*
1000
;
i_stop
=
(
(
mtime
_t
)
h2
*
3600
*
1000
+
(
mtime
_t
)
m2
*
60
*
1000
+
(
mtime
_t
)
s2
*
1000
+
(
mtime
_t
)
c2
*
10
)
*
1000
;
i_stop
=
(
(
int64
_t
)
h2
*
3600
*
1000
+
(
int64
_t
)
m2
*
60
*
1000
+
(
int64
_t
)
s2
*
1000
+
(
int64
_t
)
c2
*
10
)
*
1000
;
/* The dec expects: ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text */
if
(
p_sys
->
i_type
==
SUB_TYPE_SSA1
)
...
...
@@ -1004,7 +1004,7 @@ static int ParseVplayer( demux_t *p_demux, subtitle_t *p_subtitle )
*/
char
*
p
;
char
buffer_text
[
MAX_LINE
+
1
];
mtime
_t
i_start
;
int64
_t
i_start
;
unsigned
int
i
;
p_subtitle
->
i_start
=
0
;
...
...
@@ -1026,9 +1026,9 @@ static int ParseVplayer( demux_t *p_demux, subtitle_t *p_subtitle )
memset
(
buffer_text
,
'\0'
,
MAX_LINE
);
if
(
sscanf
(
p
,
"%d:%d:%d%[ :]%[^
\r\n
]"
,
&
h
,
&
m
,
&
s
,
&
c
,
buffer_text
)
==
5
)
{
i_start
=
(
(
mtime
_t
)
h
*
3600
*
1000
+
(
mtime
_t
)
m
*
60
*
1000
+
(
mtime
_t
)
s
*
1000
)
*
1000
;
i_start
=
(
(
int64
_t
)
h
*
3600
*
1000
+
(
int64
_t
)
m
*
60
*
1000
+
(
int64
_t
)
s
*
1000
)
*
1000
;
break
;
}
}
...
...
@@ -1085,7 +1085,7 @@ static int ParseSami( demux_t *p_demux, subtitle_t *p_subtitle )
text_t
*
txt
=
&
p_sys
->
txt
;
char
*
p
;
int
i_start
;
int
64_t
i_start
;
int
i_text
;
char
buffer_text
[
10
*
MAX_LINE
+
1
];
...
...
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