Commit 62d9e9b2 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

access: use vlc_killed()

parent fc3b19dd
......@@ -31,6 +31,7 @@
#include <vlc_access.h>
#include <vlc_sout.h>
#include <vlc_avcodec.h>
#include <vlc_interrupt.h>
#include "avio.h"
#include "../codec/avcodec/avcommon.h"
......@@ -70,7 +71,12 @@ static int OutSeek (sout_access_out_t *, off_t);
static int UrlInterruptCallback(void *access)
{
return !vlc_object_alive((access_t *)access);
/* NOTE: This works so long as libavformat invokes the callback from the
* same thread that invokes libavformat. Currently libavformat does not
* create internal threads at all. This is not proper event handling in any
* case; libavformat needs fixing. */
(void) access;
return vlc_killed();
}
struct access_sys_t
......
......@@ -285,7 +285,7 @@ static block_t *BlockScan( access_t *p_access )
i_ret = 0;
if( !vlc_object_alive (p_access) || scan_IsCancelled( p_scan ) )
if( vlc_killed() || scan_IsCancelled( p_scan ) )
break;
if( timeout >= 0 )
......
......@@ -41,6 +41,7 @@
#include <vlc_dialog.h>
#include <vlc_url.h>
#include <vlc_strings.h>
#include <vlc_interrupt.h>
#include <limits.h>
#include <assert.h>
......@@ -584,7 +585,9 @@ static int Connect( demux_t *p_demux )
}
createnew:
if( !vlc_object_alive (p_demux) )
/* FIXME: This is naive and incorrect; it does not prevent the thread
* getting stuck in blocking socket operations. */
if( vlc_killed() )
{
i_ret = VLC_EGENERIC;
goto bailout;
......
......@@ -1060,7 +1060,7 @@ static int NetFillBuffer( access_t *p_access )
do
{
if( !vlc_object_alive (p_access) )
if( vlc_killed() )
return -1;
i_ret = vlc_poll_i11e(ufd, nfd, timeout);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment