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
443a59d6
Commit
443a59d6
authored
Aug 23, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SAP: no need to keep two dates per announce
parent
9522f374
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
27 deletions
+17
-27
src/stream_output/sap.c
src/stream_output/sap.c
+17
-27
No files found.
src/stream_output/sap.c
View file @
443a59d6
/*****************************************************************************
* sap.c : SAP announce handler
*****************************************************************************
* Copyright (C) 2002-200
7
the VideoLAN team
* Copyright (C) 2002-200
8
the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
...
...
@@ -87,7 +87,6 @@ struct sap_session_t {
session_descriptor_t
*
p_sd
;
/* Last and next send */
mtime_t
i_last
;
mtime_t
i_next
;
};
...
...
@@ -97,8 +96,8 @@ struct sap_session_t {
static
void
*
RunThread
(
vlc_object_t
*
p_this
);
static
int
ComputeRate
(
sap_address_t
*
p_address
);
static
int
announce_SendSAPAnnounce
(
sap_handler_t
*
p_sap
,
sap_session_t
*
p_session
);
static
void
announce_SendSAPAnnounce
(
sap_handler_t
*
p_sap
,
sap_session_t
*
p_session
);
static
int
announce_SAPAnnounceAdd
(
sap_handler_t
*
p_sap
,
...
...
@@ -443,7 +442,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
/* If needed, build the SDP */
assert
(
p_session
->
psz_sdp
!=
NULL
);
p_sap_session
->
i_
las
t
=
0
;
p_sap_session
->
i_
nex
t
=
0
;
p_sap_session
->
i_length
=
headsize
+
strlen
(
p_session
->
psz_sdp
);
p_sap_session
->
psz_data
=
malloc
(
p_sap_session
->
i_length
+
1
);
if
(
p_sap_session
->
psz_data
==
NULL
)
...
...
@@ -545,32 +544,23 @@ static int announce_SAPAnnounceDel( sap_handler_t *p_sap,
return
VLC_SUCCESS
;
}
static
int
announce_SendSAPAnnounce
(
sap_handler_t
*
p_sap
,
sap_session_t
*
p_session
)
static
void
announce_SendSAPAnnounce
(
sap_handler_t
*
p_sap
,
sap_session_t
*
p_session
)
{
/* This announce has never been sent yet */
if
(
p_session
->
i_last
==
0
)
{
p_session
->
i_next
=
mdate
()
+
p_session
->
p_address
->
i_interval
*
1000000
;
p_session
->
i_last
=
1
;
return
VLC_SUCCESS
;
}
mtime_t
now
=
mdate
();
if
(
p_session
->
i_next
>=
now
)
return
;
if
(
p_session
->
i_next
<
mdate
()
)
ssize_t
i_ret
=
send
(
p_session
->
p_address
->
i_wfd
,
p_session
->
psz_data
,
p_session
->
i_length
,
0
);
if
(
i_ret
!=
(
ssize_t
)
p_session
->
i_length
)
{
ssize_t
i_ret
=
send
(
p_session
->
p_address
->
i_wfd
,
p_session
->
psz_data
,
p_session
->
i_length
,
0
);
if
(
i_ret
!=
(
ssize_t
)
p_session
->
i_length
)
{
msg_Warn
(
p_sap
,
"SAP send failed on address %s (%zd/%zu)"
,
p_session
->
p_address
->
psz_address
,
i_ret
,
p_session
->
i_length
);
}
p_session
->
i_last
=
p_session
->
i_next
;
p_session
->
i_next
=
p_session
->
i_last
+
p_session
->
p_address
->
i_interval
*
1000000
;
msg_Warn
(
p_sap
,
"SAP send failed on address %s (%zd/%zu)"
,
p_session
->
p_address
->
psz_address
,
i_ret
,
p_session
->
i_length
);
}
return
VLC_SUCCESS
;
p_session
->
i_next
=
now
+
p_session
->
p_address
->
i_interval
*
CLOCK_FREQ
;
}
static
int
ComputeRate
(
sap_address_t
*
p_address
)
...
...
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