Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
fc1655e1
Commit
fc1655e1
authored
Aug 26, 2013
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLS: implement pause
Close #9234
parent
b3469c26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
1 deletion
+39
-1
modules/stream_filter/httplive.c
modules/stream_filter/httplive.c
+39
-1
No files found.
modules/stream_filter/httplive.c
View file @
fc1655e1
...
...
@@ -147,6 +147,11 @@ struct stream_sys_t
bool
b_live
;
/* live stream? or vod? */
bool
b_error
;
/* parsing error */
bool
b_aesmsg
;
/* only print one time that the media is encrypted */
/* Shared data */
vlc_cond_t
wait
;
vlc_mutex_t
lock
;
bool
paused
;
};
/****************************************************************************
...
...
@@ -1799,8 +1804,14 @@ static int Prefetch(stream_t *s, int *current)
****************************************************************************/
static
int
hls_Download
(
stream_t
*
s
,
segment_t
*
segment
)
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
assert
(
segment
);
vlc_mutex_lock
(
&
p_sys
->
lock
);
while
(
p_sys
->
paused
)
vlc_cond_wait
(
&
p_sys
->
wait
,
&
p_sys
->
lock
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
stream_t
*
p_ts
=
stream_UrlNew
(
s
,
segment
->
url
);
if
(
p_ts
==
NULL
)
return
VLC_EGENERIC
;
...
...
@@ -2007,6 +2018,11 @@ static int Open(vlc_object_t *p_this)
s
->
pf_peek
=
Peek
;
s
->
pf_control
=
Control
;
p_sys
->
paused
=
false
;
vlc_cond_init
(
&
p_sys
->
wait
);
vlc_mutex_init
(
&
p_sys
->
lock
);
/* Parse HLS m3u8 content. */
uint8_t
*
buffer
=
NULL
;
ssize_t
len
=
read_M3U8_from_stream
(
s
->
p_source
,
&
buffer
);
...
...
@@ -2085,6 +2101,9 @@ fail:
}
vlc_array_destroy
(
p_sys
->
hls_stream
);
vlc_mutex_destroy
(
&
p_sys
->
lock
);
vlc_cond_destroy
(
&
p_sys
->
wait
);
/* */
free
(
p_sys
->
m3u8
);
free
(
p_sys
);
...
...
@@ -2101,6 +2120,11 @@ static void Close(vlc_object_t *p_this)
assert
(
p_sys
->
hls_stream
);
vlc_mutex_lock
(
&
p_sys
->
lock
);
p_sys
->
paused
=
false
;
vlc_cond_signal
(
&
p_sys
->
wait
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
/* */
vlc_mutex_lock
(
&
p_sys
->
download
.
lock_wait
);
/* negate the condition variable's predicate */
...
...
@@ -2128,6 +2152,10 @@ static void Close(vlc_object_t *p_this)
vlc_array_destroy
(
p_sys
->
hls_stream
);
/* */
vlc_mutex_destroy
(
&
p_sys
->
lock
);
vlc_cond_destroy
(
&
p_sys
->
wait
);
free
(
p_sys
->
m3u8
);
if
(
p_sys
->
peeked
)
block_Release
(
p_sys
->
peeked
);
...
...
@@ -2610,15 +2638,25 @@ static int Control(stream_t *s, int i_query, va_list args)
*
(
va_arg
(
args
,
bool
*
))
=
hls_MaySeek
(
s
);
break
;
case
STREAM_CAN_CONTROL_PACE
:
case
STREAM_CAN_PAUSE
:
*
(
va_arg
(
args
,
bool
*
))
=
true
;
break
;
case
STREAM_CAN_FASTSEEK
:
case
STREAM_CAN_PAUSE
:
/* TODO */
*
(
va_arg
(
args
,
bool
*
))
=
false
;
break
;
case
STREAM_GET_POSITION
:
*
(
va_arg
(
args
,
uint64_t
*
))
=
p_sys
->
playback
.
offset
;
break
;
case
STREAM_SET_PAUSE_STATE
:
{
bool
paused
=
va_arg
(
args
,
unsigned
);
vlc_mutex_lock
(
&
p_sys
->
lock
);
p_sys
->
paused
=
paused
;
vlc_cond_signal
(
&
p_sys
->
wait
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
break
;
}
case
STREAM_SET_POSITION
:
if
(
hls_MaySeek
(
s
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment