Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
64cbdb74
Commit
64cbdb74
authored
Aug 26, 2013
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
httplive: cosmetic retab
parent
675ab6e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
30 deletions
+30
-30
modules/stream_filter/httplive.c
modules/stream_filter/httplive.c
+30
-30
No files found.
modules/stream_filter/httplive.c
View file @
64cbdb74
...
...
@@ -2309,50 +2309,50 @@ static int Read(stream_t *s, void *buffer, unsigned int i_read)
while
(
length
==
0
)
{
// In case an error occurred or the stream was closed return 0
// In case an error occurred or the stream was closed return 0
if
(
p_sys
->
b_error
||
!
vlc_object_alive
(
s
))
return
0
;
// Lock the mutex before trying to read to avoid a race condition with the download thread
vlc_mutex_lock
(
&
p_sys
->
read
.
lock_wait
);
/* NOTE: buffer might be NULL if caller wants to skip data */
length
=
hls_Read
(
s
,
(
uint8_t
*
)
buffer
,
i_read
);
/* NOTE: buffer might be NULL if caller wants to skip data */
length
=
hls_Read
(
s
,
(
uint8_t
*
)
buffer
,
i_read
);
// An error has occurred in hls_Read
if
(
length
<
0
)
{
vlc_mutex_unlock
(
&
p_sys
->
read
.
lock_wait
);
// An error has occurred in hls_Read
if
(
length
<
0
)
{
vlc_mutex_unlock
(
&
p_sys
->
read
.
lock_wait
);
return
0
;
}
return
0
;
}
// There is no data available yet for the demuxer so we need to wait until reload and
// download operation are over.
// Download thread will signal once download is finished.
// A timed wait is used to avoid deadlock in case data never arrives since the thread
// running this read operation is also responsible for closing the stream
if
(
length
==
0
)
{
mtime_t
start
=
mdate
();
// There is no data available yet for the demuxer so we need to wait until reload and
// download operation are over.
// Download thread will signal once download is finished.
// A timed wait is used to avoid deadlock in case data never arrives since the thread
// running this read operation is also responsible for closing the stream
if
(
length
==
0
)
{
mtime_t
start
=
mdate
();
// Wait for 10 seconds
mtime_t
timeout_limit
=
start
+
(
10
*
UINT64_C
(
1000000
));
// Wait for 10 seconds
mtime_t
timeout_limit
=
start
+
(
10
*
UINT64_C
(
1000000
));
int
res
=
vlc_cond_timedwait
(
&
p_sys
->
read
.
wait
,
&
p_sys
->
read
.
lock_wait
,
timeout_limit
);
int
res
=
vlc_cond_timedwait
(
&
p_sys
->
read
.
wait
,
&
p_sys
->
read
.
lock_wait
,
timeout_limit
);
// Error - reached a timeout of 10 seconds without data arriving - kill the stream
if
(
res
==
ETIMEDOUT
)
{
msg_Info
(
s
,
"timeout limit reached!"
);
// Error - reached a timeout of 10 seconds without data arriving - kill the stream
if
(
res
==
ETIMEDOUT
)
{
msg_Warn
(
s
,
"timeout limit reached!"
);
vlc_mutex_unlock
(
&
p_sys
->
read
.
lock_wait
);
vlc_mutex_unlock
(
&
p_sys
->
read
.
lock_wait
);
return
0
;
}
else
if
(
res
==
EINVAL
)
return
0
;
// Error - lock is not locked so we can just return
}
return
0
;
}
else
if
(
res
==
EINVAL
)
return
0
;
// Error - lock is not locked so we can just return
}
vlc_mutex_unlock
(
&
p_sys
->
read
.
lock_wait
);
}
...
...
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