[vlc-commits] httplive: cosmetic retab
Ilkka Ollakka
git at videolan.org
Thu Sep 12 19:51:58 CEST 2013
vlc/vlc-2.1 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Mon Aug 26 16:34:53 2013 +0300| [41d77881736324866cb036ed1e452b6534eaa872] | committer: Jean-Baptiste Kempf
httplive: cosmetic retab
(cherry picked from commit 64cbdb74cf4986c036b0b4c3517d64fade02f1bb)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=41d77881736324866cb036ed1e452b6534eaa872
---
modules/stream_filter/httplive.c | 60 +++++++++++++++++++-------------------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 3ac4806..472c261 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -2337,50 +2337,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);
}
More information about the vlc-commits
mailing list