<div dir="ltr"><div><div>Hey Ilkka,<br><br></div>So both patches will be part of next VLC version, right?<br><br></div>Thanks,<br>Avishay<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 26, 2013 at 9:43 AM, Ilkka Ollakka <span dir="ltr"><<a href="mailto:ileoo@videolan.org" target="_blank">ileoo@videolan.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Aug 20, 2013 at 03:03:49AM -0400, Avishay Spitzer wrote:<br>
> I hope I understood what you meant. Let me know if it's still not ok.<br>
<br>
<br>
</div>Thanks, merged<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
> On Mon, Aug 19, 2013 at 4:31 AM, Ilkka Ollakka <<a href="mailto:ileoo@videolan.org">ileoo@videolan.org</a>> wrote:<br>
<br>
<br>
> > Thanks for your patch, if you could clean up the indentation and remove<br>
> > tabs.<br>
<br>
> > On Mon, Aug 19, 2013 at 03:11:41AM -0400, Avishay Spitzer wrote:<br>
> > > From e4c56f0bec62e679d8c0d2364cac8f7da7cbcbaa Mon Sep 17 00:00:00 2001<br>
> > > From: Avishay Spitzer <<a href="mailto:savishay@gmail.com">savishay@gmail.com</a>><br>
> > > + while (length == 0)<br>
> > > + {<br>
> > > + // In case an error occurred or the stream was closed return 0<br>
> > > + if (p_sys->b_error || !vlc_object_alive(s))<br>
> > > + return 0;<br>
<br>
> > > + // Lock the mutex before trying to read to avoid a race<br>
> > condition with the download thread<br>
> > > + vlc_mutex_lock(&p_sys->read.lock_wait);<br>
> > > +<br>
> > > + /* NOTE: buffer might be NULL if caller wants to skip data<br>
> > */<br>
> > > + length = hls_Read(s, (uint8_t*) buffer, i_read);<br>
> > > +<br>
> > > + // An error has occurred in hls_Read<br>
> > > + if (length < 0)<br>
> > > + {<br>
> > > + vlc_mutex_unlock(&p_sys->read.lock_wait);<br>
> > > +<br>
> > > + return 0;<br>
> > > + }<br>
> > > +<br>
> > > + // There is no data available yet for the demuxer so we<br>
> > need to wait until reload and<br>
> > > + // download operation are over.<br>
> > > + // Download thread will signal once download is finished.<br>
> > > + // A timed wait is used to avoid deadlock in case data<br>
> > never arrives since the thread<br>
> > > + // running this read operation is also responsible for<br>
> > closing the stream<br>
> > > + if (length == 0)<br>
> > > + {<br>
> > > + mtime_t start = mdate();<br>
> > > +<br>
> > > + // Wait for 10 seconds<br>
> > > + mtime_t timeout_limit = start + (10 *<br>
> > UINT64_C(1000000));<br>
> > > +<br>
> > > + int res = vlc_cond_timedwait(&p_sys->read.wait,<br>
> > &p_sys->read.lock_wait, timeout_limit);<br>
> > > +<br>
> > > + // Error - reached a timeout of 10 seconds without data<br>
> > arriving - kill the stream<br>
> > > + if (res == ETIMEDOUT)<br>
> > > + {<br>
> > > + msg_Info(s, "timeout limit reached!");<br>
> > > +<br>
> > > + vlc_mutex_unlock(&p_sys->read.lock_wait);<br>
> > > +<br>
> > > + return 0;<br>
> > > + }<br>
> > > + else if (res == EINVAL)<br>
> > > + return 0; // Error - lock is not locked so we can<br>
> > just return<br>
> > > + }<br>
> > > +<br>
> > > + vlc_mutex_unlock(&p_sys->read.lock_wait);<br>
> > > + }<br>
<br>
> > --<br>
> > Ilkka Ollakka<br>
> > Disc space -- the final frontier!<br>
<br>
> > _______________________________________________<br>
> > vlc-devel mailing list<br>
> > To unsubscribe or modify your subscription options:<br>
> > <a href="https://mailman.videolan.org/listinfo/vlc-devel" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Ilkka Ollakka<br>
Virtue would go far if vanity did not keep it company.<br>
-- La Rochefoucauld<br>
</font></span><br>_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
<br></blockquote></div><br></div>