Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
1afd4f37
Commit
1afd4f37
authored
Nov 24, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: dash: bytes to read != length
parent
6a8ddb34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
modules/stream_filter/dash/http/Chunk.cpp
modules/stream_filter/dash/http/Chunk.cpp
+13
-1
modules/stream_filter/dash/http/Chunk.h
modules/stream_filter/dash/http/Chunk.h
+2
-0
No files found.
modules/stream_filter/dash/http/Chunk.cpp
View file @
1afd4f37
...
...
@@ -36,6 +36,7 @@ Chunk::Chunk () :
isHostname
(
false
),
length
(
0
),
bytesRead
(
0
),
bytesToRead
(
0
),
connection
(
NULL
)
{
}
...
...
@@ -55,10 +56,14 @@ const std::string& Chunk::getUrl () const
void
Chunk
::
setEndByte
(
size_t
endByte
)
{
this
->
endByte
=
endByte
;
if
(
endByte
>
startByte
)
bytesToRead
=
endByte
-
startByte
;
}
void
Chunk
::
setStartByte
(
size_t
startByte
)
{
this
->
startByte
=
startByte
;
if
(
endByte
>
startByte
)
bytesToRead
=
endByte
-
startByte
;
}
void
Chunk
::
setUrl
(
const
std
::
string
&
url
)
{
...
...
@@ -129,10 +134,17 @@ void Chunk::setBytesRead (uint64_t bytes)
{
this
->
bytesRead
=
bytes
;
}
void
Chunk
::
setBytesToRead
(
uint64_t
bytes
)
{
bytesToRead
=
bytes
;
}
uint64_t
Chunk
::
getBytesToRead
()
const
{
return
this
->
length
-
this
->
bytesRead
;
return
length
-
bytesRead
;
}
size_t
Chunk
::
getPercentDownloaded
()
const
{
return
(
size_t
)(((
float
)
this
->
bytesRead
/
this
->
length
)
*
100
);
...
...
modules/stream_filter/dash/http/Chunk.h
View file @
1afd4f37
...
...
@@ -63,6 +63,7 @@ namespace dash
void
setConnection
(
IHTTPConnection
*
connection
);
void
setBytesRead
(
uint64_t
bytes
);
void
setBytesToRead
(
uint64_t
bytes
);
void
setLength
(
uint64_t
length
);
void
setEndByte
(
size_t
endByte
);
void
setStartByte
(
size_t
startByte
);
...
...
@@ -86,6 +87,7 @@ namespace dash
bool
isHostname
;
uint64_t
length
;
uint64_t
bytesRead
;
uint64_t
bytesToRead
;
IHTTPConnection
*
connection
;
};
}
...
...
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