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
cba9fffa
Commit
cba9fffa
authored
Nov 23, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: dash: fix double buffer alloc
parent
58e9be2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
modules/stream_filter/dash/DASHDownloader.cpp
modules/stream_filter/dash/DASHDownloader.cpp
+3
-10
modules/stream_filter/dash/http/HTTPConnectionManager.cpp
modules/stream_filter/dash/http/HTTPConnectionManager.cpp
+10
-2
modules/stream_filter/dash/http/HTTPConnectionManager.h
modules/stream_filter/dash/http/HTTPConnectionManager.h
+1
-1
No files found.
modules/stream_filter/dash/DASHDownloader.cpp
View file @
cba9fffa
...
...
@@ -58,24 +58,17 @@ void* DASHDownloader::download (void *thread_sys)
thread_sys_t
*
t_sys
=
(
thread_sys_t
*
)
thread_sys
;
HTTPConnectionManager
*
conManager
=
t_sys
->
conManager
;
BlockBuffer
*
buffer
=
t_sys
->
buffer
;
block_t
*
block
=
block_Alloc
(
BLOCKSIZE
);
int
ret
=
0
;
do
{
ret
=
conManager
->
read
(
block
);
block_t
*
block
=
NULL
;
ret
=
conManager
->
read
(
&
block
,
BLOCKSIZE
);
if
(
ret
>
0
)
{
block_t
*
bufBlock
=
block_Alloc
(
ret
);
memcpy
(
bufBlock
->
p_buffer
,
block
->
p_buffer
,
ret
);
bufBlock
->
i_length
=
block
->
i_length
;
buffer
->
put
(
bufBlock
);
}
buffer
->
put
(
block
);
}
while
(
ret
&&
!
buffer
->
getEOF
());
buffer
->
setEOF
(
true
);
block_Release
(
block
);
return
NULL
;
}
modules/stream_filter/dash/http/HTTPConnectionManager.cpp
View file @
cba9fffa
...
...
@@ -58,7 +58,7 @@ void HTTPConnectionManager::closeAllConnections
vlc_delete_all
(
this
->
connectionPool
);
vlc_delete_all
(
this
->
downloadQueue
);
}
int
HTTPConnectionManager
::
read
(
block_t
*
block
)
int
HTTPConnectionManager
::
read
(
block_t
**
pp_block
,
size_t
len
)
{
if
(
this
->
downloadQueue
.
size
()
==
0
)
if
(
!
this
->
addChunk
(
this
->
adaptationLogic
->
getNextChunk
()))
...
...
@@ -70,6 +70,10 @@ int HTTPConnectionManager::read
int
ret
=
0
;
block_t
*
block
=
block_Alloc
(
len
);
if
(
!
block
)
return
-
1
;
mtime_t
start
=
mdate
();
ret
=
this
->
downloadQueue
.
front
()
->
getConnection
()
->
read
(
block
->
p_buffer
,
block
->
i_buffer
);
mtime_t
end
=
mdate
();
...
...
@@ -80,6 +84,7 @@ int HTTPConnectionManager::read
if
(
ret
<=
0
)
{
block_Release
(
block
);
this
->
bpsLastChunk
=
this
->
bpsCurrentChunk
;
this
->
bytesReadChunk
=
0
;
this
->
timeChunk
=
0
;
...
...
@@ -87,13 +92,16 @@ int HTTPConnectionManager::read
delete
(
this
->
downloadQueue
.
front
());
this
->
downloadQueue
.
pop_front
();
return
this
->
read
(
block
);
return
this
->
read
(
pp_block
,
len
);
}
else
{
this
->
updateStatistics
(
ret
,
time
);
block
->
i_buffer
=
ret
;
}
*
pp_block
=
block
;
return
ret
;
}
void
HTTPConnectionManager
::
attach
(
IDownloadRateObserver
*
observer
)
...
...
modules/stream_filter/dash/http/HTTPConnectionManager.h
View file @
cba9fffa
...
...
@@ -49,7 +49,7 @@ namespace dash
void
closeAllConnections
();
bool
addChunk
(
Chunk
*
chunk
);
int
read
(
block_t
*
block
);
int
read
(
block_t
*
*
,
size_t
);
void
attach
(
dash
::
logic
::
IDownloadRateObserver
*
observer
);
void
notify
();
...
...
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