Commit 7656b3b4 authored by Francois Cartegnie's avatar Francois Cartegnie

stream_filter: smooth: allow pausing

parent d99bf09b
......@@ -604,6 +604,7 @@ void* sms_Thread( void *p_this )
* the n+1^th advertised audio chunk or vice versa */
uint64_t start_time = 0, lead = 0;
int64_t i_pts_delay;
for( int i = 0; i < 3; i++ )
{
......@@ -634,7 +635,13 @@ void* sms_Thread( void *p_this )
lead = get_lead( s );
while( lead > 10 * p_sys->timescale + start_time || NO_MORE_CHUNKS )
if ( stream_Control( s, STREAM_GET_PTS_DELAY, &i_pts_delay ) != VLC_SUCCESS ||
i_pts_delay < 1 )
{
i_pts_delay = 10 * p_sys->timescale + start_time;
}
while( lead > (uint64_t) i_pts_delay || NO_MORE_CHUNKS )
{
vlc_cond_wait( &p_sys->download.wait, &p_sys->download.lock_wait );
lead = get_lead( s );
......
......@@ -773,9 +773,9 @@ static int Control( stream_t *s, int i_query, va_list args )
*(va_arg( args, bool * )) = true;
break;
case STREAM_CAN_FASTSEEK:
case STREAM_CAN_PAUSE: /* TODO */
*(va_arg( args, bool * )) = false;
break;
case STREAM_CAN_PAUSE: /* TODO */
case STREAM_CAN_CONTROL_PACE:
*(va_arg( args, bool * )) = !p_sys->b_live;
break;
......@@ -798,6 +798,9 @@ static int Control( stream_t *s, int i_query, va_list args )
*va_arg (args, int64_t *) = INT64_C(1000) *
var_InheritInteger(s, "network-caching");
break;
case STREAM_SET_PAUSE_STATE:
return (p_sys->b_live) ? VLC_EGENERIC : VLC_SUCCESS;
break;
default:
return VLC_EGENERIC;
}
......
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