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
dd9a9051
Commit
dd9a9051
authored
Nov 13, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: simplify chunk usage
parent
51bbaf06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
25 deletions
+21
-25
modules/demux/adaptative/Streams.cpp
modules/demux/adaptative/Streams.cpp
+21
-24
modules/demux/adaptative/Streams.hpp
modules/demux/adaptative/Streams.hpp
+0
-1
No files found.
modules/demux/adaptative/Streams.cpp
View file @
dd9a9051
...
...
@@ -135,17 +135,6 @@ int AbstractStream::esCount() const
return
fakeesout
->
esCount
();
}
SegmentChunk
*
AbstractStream
::
getChunk
()
{
if
(
currentChunk
==
NULL
&&
!
eof
)
{
currentChunk
=
segmentTracker
->
getNextChunk
(
!
fakeesout
->
restarting
(),
connManager
);
if
(
currentChunk
==
NULL
)
eof
=
true
;
}
return
currentChunk
;
}
bool
AbstractStream
::
seekAble
()
const
{
return
(
demuxer
&&
...
...
@@ -292,44 +281,52 @@ AbstractStream::status AbstractStream::demux(mtime_t nz_deadline, bool send)
block_t
*
AbstractStream
::
readNextBlock
(
size_t
toread
)
{
SegmentChunk
*
chunk
=
getChunk
();
if
(
!
chunk
)
return
NULL
;
if
(
currentChunk
==
NULL
)
{
if
(
!
eof
)
currentChunk
=
segmentTracker
->
getNextChunk
(
!
fakeesout
->
restarting
(),
connManager
);
if
(
currentChunk
==
NULL
)
{
eof
=
true
;
return
NULL
;
}
}
if
(
format
!=
chunk
->
getStreamFormat
())
if
(
format
!=
c
urrentC
hunk
->
getStreamFormat
())
{
/* Force stream to end for this call */
msg_Info
(
p_realdemux
,
"Changing stream format %u->%u"
,
(
unsigned
)
format
,
(
unsigned
)
chunk
->
getStreamFormat
());
(
unsigned
)
format
,
(
unsigned
)
c
urrentC
hunk
->
getStreamFormat
());
restarting_output
=
true
;
format
=
chunk
->
getStreamFormat
();
format
=
c
urrentC
hunk
->
getStreamFormat
();
/* Next stream will use current unused chunk */
return
NULL
;
}
if
(
chunk
->
discontinuity
)
if
(
c
urrentC
hunk
->
discontinuity
)
{
discontinuity
=
true
;
chunk
->
discontinuity
=
false
;
c
urrentC
hunk
->
discontinuity
=
false
;
msg_Info
(
p_realdemux
,
"Encountered discontinuity"
);
return
NULL
;
}
const
bool
b_segment_head_chunk
=
(
chunk
->
getBytesRead
()
==
0
);
const
bool
b_segment_head_chunk
=
(
c
urrentC
hunk
->
getBytesRead
()
==
0
);
block_t
*
block
=
chunk
->
read
(
toread
);
block_t
*
block
=
c
urrentC
hunk
->
read
(
toread
);
if
(
block
==
NULL
)
{
delete
currentChunk
;
currentChunk
=
NULL
;
delete
chunk
;
return
NULL
;
}
if
(
chunk
->
getBytesToRead
()
==
0
)
if
(
c
urrentC
hunk
->
getBytesToRead
()
==
0
)
{
delete
currentChunk
;
currentChunk
=
NULL
;
delete
chunk
;
}
block
=
checkBlock
(
block
,
b_segment_head_chunk
);
...
...
modules/demux/adaptative/Streams.hpp
View file @
dd9a9051
...
...
@@ -91,7 +91,6 @@ namespace adaptative
bool
restarting_output
;
bool
discontinuity
;
SegmentChunk
*
getChunk
();
Demuxer
*
syncdemux
;
...
...
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