[vlc-devel] [PATCH] VLC unable to play HLS live stream

Avishay Spitzer savishay at gmail.com
Thu Aug 29 10:44:50 CEST 2013


Hey Ilkka,

So both patches will be part of next VLC version, right?

Thanks,
Avishay



On Mon, Aug 26, 2013 at 9:43 AM, Ilkka Ollakka <ileoo at videolan.org> wrote:

> On Tue, Aug 20, 2013 at 03:03:49AM -0400, Avishay Spitzer wrote:
> > I hope I understood what you meant. Let me know if it's still not ok.
>
>
> Thanks, merged
>
>
> > On Mon, Aug 19, 2013 at 4:31 AM, Ilkka Ollakka <ileoo at videolan.org>
> wrote:
>
>
> > > Thanks for your patch, if you could clean up the indentation and remove
> > > tabs.
>
> > > On Mon, Aug 19, 2013 at 03:11:41AM -0400, Avishay Spitzer wrote:
> > > > From e4c56f0bec62e679d8c0d2364cac8f7da7cbcbaa Mon Sep 17 00:00:00
> 2001
> > > > From: Avishay Spitzer <savishay at gmail.com>
> > > > +    while (length == 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);
> > > > +
> > > > +             // An error has occurred in hls_Read
> > > > +             if (length < 0)
> > > > +             {
> > > > +             vlc_mutex_unlock(&p_sys->read.lock_wait);
> > > > +
> > > > +                     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();
> > > > +
> > > > +                 // 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);
> > > > +
> > > > +             // Error - reached a timeout of 10 seconds without data
> > > arriving - kill the stream
> > > > +             if (res == ETIMEDOUT)
> > > > +             {
> > > > +                     msg_Info(s, "timeout limit reached!");
> > > > +
> > > > +                     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
> > > > +             }
> > > > +
> > > > +        vlc_mutex_unlock(&p_sys->read.lock_wait);
> > > > +    }
>
> > > --
> > > Ilkka Ollakka
> > > Disc space -- the final frontier!
>
> > > _______________________________________________
> > > vlc-devel mailing list
> > > To unsubscribe or modify your subscription options:
> > > https://mailman.videolan.org/listinfo/vlc-devel
>
>
>
>
>
>
> --
> Ilkka Ollakka
> Virtue would go far if vanity did not keep it company.
>                 -- La Rochefoucauld
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130829/bed0ec48/attachment.html>


More information about the vlc-devel mailing list