Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
b7d58da0
Commit
b7d58da0
authored
Sep 21, 2014
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
livehttp: don't open new file if current file hasn't been written to
parent
609a5fe2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
modules/access_output/livehttp.c
modules/access_output/livehttp.c
+11
-8
No files found.
modules/access_output/livehttp.c
View file @
b7d58da0
...
@@ -196,6 +196,7 @@ struct sout_access_out_sys_t
...
@@ -196,6 +196,7 @@ struct sout_access_out_sys_t
bool
b_splitanywhere
;
bool
b_splitanywhere
;
bool
b_caching
;
bool
b_caching
;
bool
b_generate_iv
;
bool
b_generate_iv
;
bool
b_segment_has_data
;
uint8_t
aes_ivs
[
16
];
uint8_t
aes_ivs
[
16
];
gcry_cipher_hd_t
aes_ctx
;
gcry_cipher_hd_t
aes_ctx
;
char
*
key_uri
;
char
*
key_uri
;
...
@@ -241,6 +242,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -241,6 +242,7 @@ static int Open( vlc_object_t *p_this )
p_sys
->
b_ratecontrol
=
var_GetBool
(
p_access
,
SOUT_CFG_PREFIX
"ratecontrol"
)
;
p_sys
->
b_ratecontrol
=
var_GetBool
(
p_access
,
SOUT_CFG_PREFIX
"ratecontrol"
)
;
p_sys
->
b_caching
=
var_GetBool
(
p_access
,
SOUT_CFG_PREFIX
"caching"
)
;
p_sys
->
b_caching
=
var_GetBool
(
p_access
,
SOUT_CFG_PREFIX
"caching"
)
;
p_sys
->
b_generate_iv
=
var_GetBool
(
p_access
,
SOUT_CFG_PREFIX
"generate-iv"
)
;
p_sys
->
b_generate_iv
=
var_GetBool
(
p_access
,
SOUT_CFG_PREFIX
"generate-iv"
)
;
p_sys
->
b_segment_has_data
=
false
;
p_sys
->
segments_t
=
vlc_array_new
();
p_sys
->
segments_t
=
vlc_array_new
();
...
@@ -764,7 +766,7 @@ static void Close( vlc_object_t * p_this )
...
@@ -764,7 +766,7 @@ static void Close( vlc_object_t * p_this )
/* Since we are flushing, check the segment change by hand and don't wait
/* Since we are flushing, check the segment change by hand and don't wait
* possible keyframe*/
* possible keyframe*/
if
(
(
float
)(
output_block
->
i_length
+
p_sys
->
i_dts_offset
+
if
(
p_sys
->
b_segment_has_data
&&
(
float
)(
output_block
->
i_length
+
p_sys
->
i_dts_offset
+
output_block
->
i_dts
-
p_sys
->
i_opendts
)
>=
p_sys
->
i_seglenm
)
output_block
->
i_dts
-
p_sys
->
i_opendts
)
>=
p_sys
->
i_seglenm
)
{
{
closeCurrentSegment
(
p_access
,
p_sys
,
false
);
closeCurrentSegment
(
p_access
,
p_sys
,
false
);
...
@@ -896,6 +898,7 @@ static ssize_t openNextFile( sout_access_out_t *p_access, sout_access_out_sys_t
...
@@ -896,6 +898,7 @@ static ssize_t openNextFile( sout_access_out_t *p_access, sout_access_out_sys_t
p_sys
->
psz_cursegPath
=
strdup
(
segment
->
psz_filename
);
p_sys
->
psz_cursegPath
=
strdup
(
segment
->
psz_filename
);
p_sys
->
i_handle
=
fd
;
p_sys
->
i_handle
=
fd
;
p_sys
->
i_segment
=
i_newseg
;
p_sys
->
i_segment
=
i_newseg
;
p_sys
->
b_segment_has_data
=
false
;
return
fd
;
return
fd
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -918,15 +921,14 @@ static int CheckSegmentChange( sout_access_out_t *p_access, block_t *p_buffer )
...
@@ -918,15 +921,14 @@ static int CheckSegmentChange( sout_access_out_t *p_access, block_t *p_buffer )
msg_Dbg
(
p_access
,
"dts offset %"
PRId64
,
p_sys
->
i_dts_offset
);
msg_Dbg
(
p_access
,
"dts offset %"
PRId64
,
p_sys
->
i_dts_offset
);
}
}
if
(
p_sys
->
i_handle
>
0
&&
if
(
p_sys
->
i_handle
>
0
&&
p_sys
->
b_segment_has_data
&&
((
p_buffer
->
i_dts
-
p_sys
->
i_opendts
+
((
p_buffer
->
i_length
+
p_buffer
->
i_dts
-
p_sys
->
i_opendts
+
p_buffer
->
i_length
+
p_sys
->
i_dts_offset
p_sys
->
i_dts_offset
)
>=
p_sys
->
i_seglenm
)
)
)
>=
p_sys
->
i_seglenm
)
)
{
{
closeCurrentSegment
(
p_access
,
p_sys
,
false
);
closeCurrentSegment
(
p_access
,
p_sys
,
false
);
}
}
if
(
p_sys
->
i_handle
<
0
)
if
(
unlikely
(
p_sys
->
i_handle
<
0
)
)
{
{
p_sys
->
i_dts_offset
=
0
;
p_sys
->
i_dts_offset
=
0
;
p_sys
->
i_opendts
=
output
?
output
->
i_dts
:
p_buffer
->
i_dts
;
p_sys
->
i_opendts
=
output
?
output
->
i_dts
:
p_buffer
->
i_dts
;
...
@@ -989,8 +991,8 @@ static ssize_t writeSegment( sout_access_out_t *p_access )
...
@@ -989,8 +991,8 @@ static ssize_t writeSegment( sout_access_out_t *p_access )
}
}
p_sys
->
f_seglen
=
p_sys
->
f_seglen
=
(
float
)(
output
->
i_length
+
p_sys
->
i_dts_offset
+
(
float
)(
output
->
i_length
+
output
->
i_dts
-
p_sys
->
i_opendts
)
/
CLOCK_FREQ
;
output
->
i_dts
-
p_sys
->
i_opendts
+
p_sys
->
i_dts_offset
)
/
CLOCK_FREQ
;
if
(
(
size_t
)
val
>=
output
->
i_buffer
)
if
(
(
size_t
)
val
>=
output
->
i_buffer
)
{
{
...
@@ -1033,6 +1035,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
...
@@ -1033,6 +1035,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
block_ChainRelease
(
p_buffer
);
block_ChainRelease
(
p_buffer
);
return
-
1
;
return
-
1
;
}
}
p_sys
->
b_segment_has_data
=
true
;
i_write
+=
writevalue
;
i_write
+=
writevalue
;
}
}
...
...
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