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
ee31841e
Commit
ee31841e
authored
9 years ago
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adptative: add missing remainder doing stats
parent
2ff8049f
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
+10
-4
modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
+1
-0
No files found.
modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
View file @
ee31841e
...
...
@@ -38,7 +38,7 @@ using namespace adaptative::logic;
RateBasedAdaptationLogic
::
RateBasedAdaptationLogic
(
int
w
,
int
h
)
:
AbstractAdaptationLogic
(),
bpsAvg
(
0
),
bpsSamplecount
(
0
),
bpsAvg
(
0
),
bps
Remainder
(
0
),
bps
Samplecount
(
0
),
currentBps
(
0
)
{
width
=
w
;
...
...
@@ -68,12 +68,18 @@ void RateBasedAdaptationLogic::updateDownloadRate(size_t size, mtime_t time)
if
(
unlikely
(
time
==
0
))
return
;
size_t
current
=
size
*
8000
/
time
;
size_t
current
=
bpsRemainder
+
size
*
8000
/
time
;
if
(
current
>=
bpsAvg
)
bpsAvg
=
bpsAvg
+
(
current
-
bpsAvg
)
/
++
bpsSamplecount
;
{
bpsAvg
+=
(
current
-
bpsAvg
)
/
++
bpsSamplecount
;
bpsRemainder
=
(
current
-
bpsAvg
)
%
bpsSamplecount
;
}
else
bpsAvg
=
bpsAvg
-
(
bpsAvg
-
current
)
/
++
bpsSamplecount
;
{
bpsAvg
-=
(
bpsAvg
-
current
)
/
++
bpsSamplecount
;
bpsRemainder
=
(
bpsAvg
-
current
)
%
bpsSamplecount
;
}
cumulatedTime
+=
time
;
if
(
cumulatedTime
>
4
*
CLOCK_FREQ
/
stabilizer
)
...
...
This diff is collapsed.
Click to expand it.
modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
View file @
ee31841e
...
...
@@ -46,6 +46,7 @@ namespace adaptative
int
width
;
int
height
;
size_t
bpsAvg
;
size_t
bpsRemainder
;
size_t
bpsSamplecount
;
size_t
currentBps
;
mtime_t
cumulatedTime
;
...
...
This diff is collapsed.
Click to expand it.
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