Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
2678b03b
Commit
2678b03b
authored
Sep 23, 2015
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: convert tracker to use getNextSegment
parent
6e2fb50e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
19 deletions
+11
-19
modules/demux/adaptative/SegmentTracker.cpp
modules/demux/adaptative/SegmentTracker.cpp
+11
-18
modules/demux/adaptative/SegmentTracker.hpp
modules/demux/adaptative/SegmentTracker.hpp
+0
-1
No files found.
modules/demux/adaptative/SegmentTracker.cpp
View file @
2678b03b
...
...
@@ -34,7 +34,6 @@ SegmentTracker::SegmentTracker(AbstractAdaptationLogic *logic_, BaseAdaptationSe
initializing
=
true
;
index_sent
=
false
;
init_sent
=
false
;
sequence_set
=
false
;
prevRepresentation
=
NULL
;
setAdaptationLogic
(
logic_
);
adaptationSet
=
adaptSet
;
...
...
@@ -52,7 +51,6 @@ void SegmentTracker::setAdaptationLogic(AbstractAdaptationLogic *logic_)
void
SegmentTracker
::
resetCounter
()
{
sequence_set
=
false
;
prevRepresentation
=
NULL
;
}
...
...
@@ -89,18 +87,6 @@ SegmentChunk * SegmentTracker::getNextChunk(bool switch_allowed)
if
(
rep
->
needsUpdate
())
updateSelected
();
/* If we're starting, set the first segment number to download */
if
(
!
sequence_set
)
{
if
(
!
rep
->
getSegmentNumberByTime
(
VLC_TS_INVALID
,
&
count
)
)
{
msg_Warn
(
rep
->
getPlaylist
()
->
getVLCObject
(),
"Can't get first segment number for representation %s"
,
rep
->
getID
().
str
().
c_str
()
);
count
=
0
;
}
sequence_set
=
true
;
}
if
(
!
init_sent
)
{
init_sent
=
true
;
...
...
@@ -117,12 +103,20 @@ SegmentChunk * SegmentTracker::getNextChunk(bool switch_allowed)
return
segment
->
toChunk
(
count
,
rep
);
}
segment
=
rep
->
getSegment
(
BaseRepresentation
::
INFOTYPE_MEDIA
,
count
);
bool
b_gap
=
false
;
segment
=
rep
->
getNextSegment
(
BaseRepresentation
::
INFOTYPE_MEDIA
,
count
,
&
count
,
&
b_gap
);
if
(
b_gap
&&
count
)
{
notify
(
SegmentTrackerListenerInterface
::
notifications
::
NOTIFICATION_DISCONTINUITY
,
segment
);
}
if
(
!
segment
)
{
resetCounter
();
return
NULL
;
}
/* stop initializing after 1st chunk */
initializing
=
false
;
...
...
@@ -155,12 +149,11 @@ void SegmentTracker::setPositionByNumber(uint64_t segnumber, bool restarted)
init_sent
=
false
;
}
count
=
segnumber
;
sequence_set
=
true
;
}
mtime_t
SegmentTracker
::
getSegmentStart
()
const
{
if
(
prevRepresentation
&&
sequence_set
)
if
(
prevRepresentation
)
return
prevRepresentation
->
getPlaybackTimeBySegmentNumber
(
count
);
else
return
0
;
...
...
@@ -174,7 +167,7 @@ void SegmentTracker::registerListener(SegmentTrackerListenerInterface *listener)
void
SegmentTracker
::
pruneFromCurrent
()
{
AbstractPlaylist
*
playlist
=
adaptationSet
->
getPlaylist
();
if
(
playlist
->
isLive
()
&&
sequence_set
)
if
(
playlist
->
isLive
())
playlist
->
pruneBySegmentNumber
(
count
);
}
...
...
modules/demux/adaptative/SegmentTracker.hpp
View file @
2678b03b
...
...
@@ -77,7 +77,6 @@ namespace adaptative
bool
initializing
;
bool
index_sent
;
bool
init_sent
;
bool
sequence_set
;
uint64_t
count
;
AbstractAdaptationLogic
*
logic
;
BaseAdaptationSet
*
adaptationSet
;
...
...
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