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
02c07d35
Commit
02c07d35
authored
Nov 18, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: dash: simplify getting duration
parent
d91beca3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
modules/stream_filter/dash/DASHManager.cpp
modules/stream_filter/dash/DASHManager.cpp
+13
-2
modules/stream_filter/dash/DASHManager.h
modules/stream_filter/dash/DASHManager.h
+1
-1
modules/stream_filter/dash/dash.cpp
modules/stream_filter/dash/dash.cpp
+1
-12
No files found.
modules/stream_filter/dash/DASHManager.cpp
View file @
02c07d35
...
...
@@ -97,9 +97,20 @@ const mpd::MPDManager* DASHManager::getMpdManager() const
return
this
->
mpdManager
;
}
const
logic
::
IAdaptationLogic
*
DASHManager
::
getAdaptionLogic
()
const
mtime_t
DASHManager
::
getDuration
()
const
{
return
this
->
adaptationLogic
;
if
(
mpd
->
isLive
())
{
return
0
;
}
else
{
const
Representation
*
rep
=
adaptationLogic
->
getCurrentRepresentation
();
if
(
!
rep
)
return
0
;
else
return
mpd
->
getDuration
()
*
rep
->
getBandwidth
()
/
8
;
}
}
const
Chunk
*
DASHManager
::
getCurrentChunk
()
const
...
...
modules/stream_filter/dash/DASHManager.h
View file @
02c07d35
...
...
@@ -50,7 +50,7 @@ namespace dash
int
seekBackwards
(
unsigned
len
);
const
mpd
::
MPDManager
*
getMpdManager
()
const
;
const
logic
::
IAdaptationLogic
*
getAdaptionLogic
()
const
;
mtime_t
getDuration
()
const
;
const
http
::
Chunk
*
getCurrentChunk
()
const
;
private:
...
...
modules/stream_filter/dash/dash.cpp
View file @
02c07d35
...
...
@@ -81,7 +81,6 @@ struct stream_sys_t
dash
::
DASHManager
*
p_dashManager
;
dash
::
mpd
::
MPD
*
p_mpd
;
uint64_t
position
;
bool
isLive
;
};
static
int
Read
(
stream_t
*
p_stream
,
void
*
p_ptr
,
unsigned
int
i_len
);
...
...
@@ -129,7 +128,6 @@ static int Open(vlc_object_t *p_obj)
}
p_sys
->
p_dashManager
=
p_dashManager
;
p_sys
->
position
=
0
;
p_sys
->
isLive
=
p_dashManager
->
getMpdManager
()
->
getMPD
()
->
isLive
();
p_stream
->
p_sys
=
p_sys
;
p_stream
->
pf_read
=
Read
;
p_stream
->
pf_peek
=
Peek
;
...
...
@@ -276,16 +274,7 @@ static int Control (stream_t *p_stream, int i_query, va_list args)
case
STREAM_GET_SIZE
:
{
uint64_t
*
res
=
(
va_arg
(
args
,
uint64_t
*
));
if
(
p_sys
->
isLive
)
*
res
=
0
;
else
{
const
dash
::
mpd
::
Representation
*
rep
=
p_sys
->
p_dashManager
->
getAdaptionLogic
()
->
getCurrentRepresentation
();
if
(
rep
==
NULL
)
*
res
=
0
;
else
*
res
=
p_sys
->
p_mpd
->
getDuration
()
*
rep
->
getBandwidth
()
/
8
;
}
*
res
=
p_sys
->
p_dashManager
->
getDuration
();
break
;
}
case
STREAM_GET_PTS_DELAY
:
...
...
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