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
73dec06b
Commit
73dec06b
authored
Aug 24, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hds: simplify pf_read()
parent
bbb02213
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
31 deletions
+8
-31
modules/stream_filter/hds/hds.c
modules/stream_filter/hds/hds.c
+8
-31
No files found.
modules/stream_filter/hds/hds.c
View file @
73dec06b
...
@@ -1736,9 +1736,7 @@ static int send_flv_header( hds_stream_t *stream, stream_sys_t* p_sys,
...
@@ -1736,9 +1736,7 @@ static int send_flv_header( hds_stream_t *stream, stream_sys_t* p_sys,
static
unsigned
read_chunk_data
(
static
unsigned
read_chunk_data
(
vlc_object_t
*
p_this
,
vlc_object_t
*
p_this
,
uint8_t
*
buffer
,
unsigned
read_len
,
uint8_t
*
buffer
,
unsigned
read_len
,
hds_stream_t
*
stream
,
hds_stream_t
*
stream
)
bool
*
eof
)
{
{
stream_t
*
s
=
(
stream_t
*
)
p_this
;
stream_t
*
s
=
(
stream_t
*
)
p_this
;
stream_sys_t
*
sys
=
s
->
p_sys
;
stream_sys_t
*
sys
=
s
->
p_sys
;
...
@@ -1746,10 +1744,8 @@ static unsigned read_chunk_data(
...
@@ -1746,10 +1744,8 @@ static unsigned read_chunk_data(
uint8_t
*
buffer_start
=
buffer
;
uint8_t
*
buffer_start
=
buffer
;
bool
dl
=
false
;
bool
dl
=
false
;
if
(
chunk
&&
chunk
->
eof
&&
chunk
->
mdat_pos
>=
chunk
->
mdat_len
)
{
if
(
chunk
&&
chunk
->
eof
&&
chunk
->
mdat_pos
>=
chunk
->
mdat_len
)
*
eof
=
true
;
return
0
;
return
0
;
}
while
(
chunk
&&
chunk
->
data
&&
read_len
>
0
&&
!
(
chunk
->
eof
&&
chunk
->
mdat_pos
>=
chunk
->
mdat_len
)
)
while
(
chunk
&&
chunk
->
data
&&
read_len
>
0
&&
!
(
chunk
->
eof
&&
chunk
->
mdat_pos
>=
chunk
->
mdat_len
)
)
{
{
...
@@ -1773,11 +1769,6 @@ static unsigned read_chunk_data(
...
@@ -1773,11 +1769,6 @@ static unsigned read_chunk_data(
if
(
!
sys
->
live
&&
(
chunk
->
mdat_pos
>=
chunk
->
mdat_len
||
chunk
->
failed
)
)
if
(
!
sys
->
live
&&
(
chunk
->
mdat_pos
>=
chunk
->
mdat_len
||
chunk
->
failed
)
)
{
{
if
(
chunk
->
eof
)
{
*
eof
=
true
;
}
/* make sure there is at least one chunk in the queue */
/* make sure there is at least one chunk in the queue */
if
(
!
chunk
->
next
&&
!
chunk
->
eof
)
if
(
!
chunk
->
next
&&
!
chunk
->
eof
)
{
{
...
@@ -1847,32 +1838,18 @@ static ssize_t Read( stream_t *s, void *buffer, size_t i_read )
...
@@ -1847,32 +1838,18 @@ static ssize_t Read( stream_t *s, void *buffer, size_t i_read )
if
(
vlc_array_count
(
p_sys
->
hds_streams
)
==
0
)
if
(
vlc_array_count
(
p_sys
->
hds_streams
)
==
0
)
return
0
;
return
0
;
if
(
unlikely
(
i_read
==
0
)
)
return
0
;
// TODO: change here for selectable stream
// TODO: change here for selectable stream
hds_stream_t
*
stream
=
s
->
p_sys
->
hds_streams
->
pp_elems
[
0
];
hds_stream_t
*
stream
=
s
->
p_sys
->
hds_streams
->
pp_elems
[
0
];
int
length
=
0
;
uint8_t
*
buffer_uint8
=
(
uint8_t
*
)
buffer
;
if
(
header_unfinished
(
p_sys
)
)
if
(
header_unfinished
(
p_sys
)
)
{
return
send_flv_header
(
stream
,
p_sys
,
buffer
,
i_read
);
unsigned
hdr_bytes
=
send_flv_header
(
stream
,
p_sys
,
buffer
,
i_read
);
length
+=
hdr_bytes
;
i_read
-=
hdr_bytes
;
buffer_uint8
+=
hdr_bytes
;
}
bool
eof
=
false
;
while
(
i_read
>
0
&&
!
eof
)
{
int
tmp_length
=
read_chunk_data
(
(
vlc_object_t
*
)
s
,
buffer_uint8
,
i_read
,
stream
,
&
eof
);
buffer_uint8
+=
tmp_length
;
i_read
-=
tmp_length
;
length
+=
tmp_length
;
p_sys
->
playback_offset
+=
tmp_length
;
}
return
length
;
i_read
=
read_chunk_data
(
(
vlc_object_t
*
)
s
,
buffer
,
i_read
,
stream
);
p_sys
->
playback_offset
+=
i_read
;
return
i_read
;
}
}
static
int
Control
(
stream_t
*
s
,
int
i_query
,
va_list
args
)
static
int
Control
(
stream_t
*
s
,
int
i_query
,
va_list
args
)
...
...
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