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
dd9a9051
Commit
dd9a9051
authored
Nov 13, 2015
by
François 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