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
39589fb6
Commit
39589fb6
authored
Nov 10, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: don't compute bw stats from tiny chunks
parent
ff3e1e6e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
4 deletions
+9
-4
modules/demux/adaptative/http/Chunk.cpp
modules/demux/adaptative/http/Chunk.cpp
+2
-2
modules/demux/adaptative/http/Chunk.h
modules/demux/adaptative/http/Chunk.h
+2
-0
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
+3
-1
modules/demux/adaptative/plumbing/SourceStream.cpp
modules/demux/adaptative/plumbing/SourceStream.cpp
+2
-1
No files found.
modules/demux/adaptative/http/Chunk.cpp
View file @
39589fb6
...
@@ -230,8 +230,8 @@ HTTPChunkBufferedSource::~HTTPChunkBufferedSource()
...
@@ -230,8 +230,8 @@ HTTPChunkBufferedSource::~HTTPChunkBufferedSource()
void
HTTPChunkBufferedSource
::
bufferize
(
size_t
readsize
)
void
HTTPChunkBufferedSource
::
bufferize
(
size_t
readsize
)
{
{
if
(
readsize
<
32768
)
if
(
readsize
<
HTTPChunkSource
::
CHUNK_SIZE
)
readsize
=
32768
;
readsize
=
HTTPChunkSource
::
CHUNK_SIZE
;
if
(
contentLength
&&
readsize
>
contentLength
-
consumed
)
if
(
contentLength
&&
readsize
>
contentLength
-
consumed
)
readsize
=
contentLength
-
consumed
;
readsize
=
contentLength
-
consumed
;
...
...
modules/demux/adaptative/http/Chunk.h
View file @
39589fb6
...
@@ -84,6 +84,8 @@ namespace adaptative
...
@@ -84,6 +84,8 @@ namespace adaptative
virtual
block_t
*
read
(
size_t
);
/* impl */
virtual
block_t
*
read
(
size_t
);
/* impl */
static
const
size_t
CHUNK_SIZE
=
32768
;
protected:
protected:
virtual
block_t
*
consume
(
size_t
);
virtual
block_t
*
consume
(
size_t
);
HTTPConnection
*
connection
;
HTTPConnection
*
connection
;
...
...
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
View file @
39589fb6
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include "../playlist/BaseRepresentation.h"
#include "../playlist/BaseRepresentation.h"
#include "../playlist/BasePeriod.h"
#include "../playlist/BasePeriod.h"
#include "../http/Chunk.h"
using
namespace
adaptative
::
logic
;
using
namespace
adaptative
::
logic
;
...
@@ -62,12 +63,13 @@ BaseRepresentation *RateBasedAdaptationLogic::getNextRepresentation(BaseAdaptati
...
@@ -62,12 +63,13 @@ BaseRepresentation *RateBasedAdaptationLogic::getNextRepresentation(BaseAdaptati
if
(
rep
==
NULL
)
if
(
rep
==
NULL
)
return
NULL
;
return
NULL
;
}
}
return
rep
;
return
rep
;
}
}
void
RateBasedAdaptationLogic
::
updateDownloadRate
(
size_t
size
,
mtime_t
time
)
void
RateBasedAdaptationLogic
::
updateDownloadRate
(
size_t
size
,
mtime_t
time
)
{
{
if
(
unlikely
(
time
==
0
))
if
(
unlikely
(
time
==
0
)
||
size
<
(
HTTPChunkSource
::
CHUNK_SIZE
>>
1
)
)
return
;
return
;
size_t
current
=
bpsRemainder
+
CLOCK_FREQ
*
size
*
8
/
time
;
size_t
current
=
bpsRemainder
+
CLOCK_FREQ
*
size
*
8
/
time
;
...
...
modules/demux/adaptative/plumbing/SourceStream.cpp
View file @
39589fb6
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "SourceStream.hpp"
#include "SourceStream.hpp"
#include "../ChunksSource.hpp"
#include "../ChunksSource.hpp"
#include "../http/Chunk.h"
#include <vlc_stream.h>
#include <vlc_stream.h>
#include <vlc_demux.h>
#include <vlc_demux.h>
...
@@ -70,7 +71,7 @@ ssize_t ChunksSourceStream::Read(uint8_t *buf, size_t size)
...
@@ -70,7 +71,7 @@ ssize_t ChunksSourceStream::Read(uint8_t *buf, size_t size)
while
(
i_toread
&&
!
b_eof
)
while
(
i_toread
&&
!
b_eof
)
{
{
const
size_t
i_blocksize
=
__MAX
(
i_toread
,
32768
);
const
size_t
i_blocksize
=
__MAX
(
i_toread
,
http
::
HTTPChunkSource
::
CHUNK_SIZE
);
if
(
!
p_block
&&
!
(
p_block
=
source
->
readNextBlock
(
i_blocksize
)))
if
(
!
p_block
&&
!
(
p_block
=
source
->
readNextBlock
(
i_blocksize
)))
{
{
b_eof
=
true
;
b_eof
=
true
;
...
...
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