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
ca3b58b2
Commit
ca3b58b2
authored
Feb 28, 2006
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Use stream_UrlNew for vobsub loading instead of fopen. closes #567
parent
576a7246
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
modules/demux/vobsub.c
modules/demux/vobsub.c
+11
-11
No files found.
modules/demux/vobsub.c
View file @
ca3b58b2
...
...
@@ -94,7 +94,7 @@ struct demux_sys_t
int64_t
i_length
;
text_t
txt
;
FILE
*
p_vobsub_file
;
stream_t
*
p_vobsub_stream
;
/* all tracks */
int
i_tracks
;
...
...
@@ -147,7 +147,7 @@ static int Open ( vlc_object_t *p_this )
p_demux
->
pf_control
=
Control
;
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_
stream
=
NULL
;
p_sys
->
i_tracks
=
0
;
p_sys
->
track
=
(
vobsub_track_t
*
)
malloc
(
sizeof
(
vobsub_track_t
)
);
p_sys
->
i_original_frame_width
=
-
1
;
...
...
@@ -183,15 +183,16 @@ static int Open ( vlc_object_t *p_this )
memcpy
(
psz_vobname
+
i_len
-
4
,
".sub"
,
4
);
/* open file */
p_sys
->
p_vobsub_file
=
utf8_fopen
(
psz_vobname
,
"rb"
);
free
(
psz_vobname
);
if
(
p_sys
->
p_vobsub_file
==
NULL
)
p_sys
->
p_vobsub_stream
=
stream_UrlNew
(
p_demux
,
psz_vobname
);
if
(
p_sys
->
p_vobsub_stream
==
NULL
)
{
msg_Err
(
p_demux
,
"couldn't open .sub Vobsub file: %s"
,
psz_vobname
);
free
(
psz_vobname
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
free
(
psz_vobname
);
return
VLC_SUCCESS
;
}
...
...
@@ -212,8 +213,8 @@ static void Close( vlc_object_t *p_this )
}
if
(
p_sys
->
track
)
free
(
p_sys
->
track
);
if
(
p_sys
->
p_vobsub_
file
)
fclose
(
p_sys
->
p_vobsub_file
);
if
(
p_sys
->
p_vobsub_
stream
)
stream_Delete
(
p_sys
->
p_vobsub_stream
);
free
(
p_sys
);
}
...
...
@@ -362,10 +363,10 @@ static int Demux( demux_t *p_demux )
if
(
i_size
<=
0
)
i_size
=
65535
;
/* Invalid or EOF */
/* Seek at the right place */
if
(
fseek
(
p_sys
->
p_vobsub_file
,
i_pos
,
SEEK_SET
)
)
if
(
stream_Seek
(
p_sys
->
p_vobsub_stream
,
i_pos
)
)
{
msg_Warn
(
p_demux
,
"cannot seek
at right vobsub location
%d"
,
i_pos
);
"cannot seek
in the VobSub to the correct time
%d"
,
i_pos
);
tk
.
i_current_subtitle
++
;
continue
;
}
...
...
@@ -378,8 +379,7 @@ static int Demux( demux_t *p_demux )
}
/* read data */
p_block
->
i_buffer
=
fread
(
p_block
->
p_buffer
,
1
,
i_size
,
p_sys
->
p_vobsub_file
);
p_block
->
i_buffer
=
stream_Read
(
p_sys
->
p_vobsub_stream
,
p_block
->
p_buffer
,
i_size
);
if
(
p_block
->
i_buffer
<=
6
)
{
block_Release
(
p_block
);
...
...
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