Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
GSoC
GSoC2018
macOS
vlc
Commits
914983b3
Commit
914983b3
authored
Apr 18, 2018
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VLSub: Fix hash generation error handling
parent
7f2cc34c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
share/lua/extensions/VLSub.lua
share/lua/extensions/VLSub.lua
+7
-4
No files found.
share/lua/extensions/VLSub.lua
View file @
914983b3
...
...
@@ -1297,21 +1297,24 @@ openSub = {
local
data_end
=
""
local
size
local
chunk_size
=
65536
local
ok
local
err
-- Get data for hash calculation
vlc
.
msg
.
dbg
(
"[VLSub] Read hash data from stream"
)
local
file
=
vlc
.
stream
(
openSub
.
file
.
uri
)
size
=
file
:
getsize
()
data_start
=
file
:
read
(
chunk_size
)
ok
,
size
=
pcall
(
file
.
getsize
,
file
)
if
not
size
then
vlc
.
msg
.
warn
(
"[VLSub] Failed to get stream size
"
)
vlc
.
msg
.
warn
(
"[VLSub] Failed to get stream size
: "
..
size
)
setError
(
lang
[
"mess_err_hash"
])
return
false
end
if
not
file
:
seek
(
size
-
chunk_size
)
then
vlc
.
msg
.
warn
(
"[VLSub] Failed to seek to the end of the stream"
)
ok
,
err
=
pcall
(
file
.
seek
,
file
,
size
-
chunk_size
)
if
not
ok
then
vlc
.
msg
.
warn
(
"[VLSub] Failed to seek to the end of the stream: "
..
err
)
setError
(
lang
[
"mess_err_hash"
])
return
false
end
...
...
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