Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
b49fde0c
Commit
b49fde0c
authored
Sep 21, 2004
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fix the vobsub length.
fen: any suggestions for the other Control() stuff?
parent
74ffc8e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
modules/demux/vobsub.c
modules/demux/vobsub.c
+20
-4
No files found.
modules/demux/vobsub.c
View file @
b49fde0c
...
@@ -113,11 +113,13 @@ static int Open ( vlc_object_t *p_this )
...
@@ -113,11 +113,13 @@ static int Open ( vlc_object_t *p_this )
{
{
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_sys_t
*
p_sys
;
demux_sys_t
*
p_sys
;
int
i_max
;
int
i_len
;
char
*
psz_vobname
;
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
p_demux
->
pf_control
=
Control
;
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
p_sys
->
i_length
=
0
;
p_sys
->
p_vobsub_file
=
NULL
;
p_sys
->
p_vobsub_file
=
NULL
;
p_sys
->
i_tracks
=
0
;
p_sys
->
i_tracks
=
0
;
p_sys
->
track
=
(
vobsub_track_t
*
)
malloc
(
sizeof
(
vobsub_track_t
)
);
p_sys
->
track
=
(
vobsub_track_t
*
)
malloc
(
sizeof
(
vobsub_track_t
)
);
...
@@ -156,8 +158,22 @@ static int Open ( vlc_object_t *p_this )
...
@@ -156,8 +158,22 @@ static int Open ( vlc_object_t *p_this )
/* Unload */
/* Unload */
TextUnload
(
&
p_sys
->
txt
);
TextUnload
(
&
p_sys
->
txt
);
int
i_len
=
strlen
(
p_demux
->
psz_path
);
/* Find the total length of the vobsubs */
char
*
psz_vobname
=
strdup
(
p_demux
->
psz_path
);
if
(
p_sys
->
i_tracks
>
0
)
{
int
i
;
for
(
i
=
0
;
i
<
p_sys
->
i_tracks
)
{
if
(
p_sys
->
track
[
i
]
->
i_subtitles
>
1
)
{
if
(
p_sys
->
track
[
i
]
->
p_subtitles
[
p_sys
->
track
[
i
]
->
i_subtitles
-
1
]
->
i_start
>
p_sys
->
i_length
)
p_sys
->
i_length
=
(
mtime_t
)
p_sys
->
track
[
i
]
->
p_subtitles
[
p_sys
->
track
[
i
]
->
i_subtitles
-
1
]
->
i_start
+
1
*
1000
*
1000
;
}
}
}
i_len
=
strlen
(
p_demux
->
psz_path
);
psz_vobname
=
strdup
(
p_demux
->
psz_path
);
strcpy
(
psz_vobname
+
i_len
-
4
,
".sub"
);
strcpy
(
psz_vobname
+
i_len
-
4
,
".sub"
);
...
@@ -203,7 +219,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
...
@@ -203,7 +219,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{
{
case
DEMUX_GET_LENGTH
:
case
DEMUX_GET_LENGTH
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
//
*pi64 = p_sys->i_length;
*
pi64
=
p_sys
->
i_length
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
case
DEMUX_GET_TIME
:
case
DEMUX_GET_TIME
:
...
...
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