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
6b7771a4
Commit
6b7771a4
authored
Oct 23, 2010
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shout: cosmetics.
parent
26256b99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
modules/access_output/shout.c
modules/access_output/shout.c
+14
-15
No files found.
modules/access_output/shout.c
View file @
6b7771a4
...
...
@@ -232,10 +232,8 @@ static int Open( vlc_object_t *p_this )
free
(
psz_genre
);
free
(
psz_url
);
if
(
var_GetBool
(
p_access
,
SOUT_CFG_PREFIX
"mp3"
)
)
i_ret
=
shout_set_format
(
p_shout
,
SHOUT_FORMAT_MP3
);
else
i_ret
=
shout_set_format
(
p_shout
,
SHOUT_FORMAT_OGG
);
i_ret
=
shout_set_format
(
p_shout
,
var_GetBool
(
p_access
,
SOUT_CFG_PREFIX
"mp3"
)
?
SHOUT_FORMAT_MP3
:
SHOUT_FORMAT_OGG
);
if
(
i_ret
!=
SHOUTERR_SUCCESS
)
{
...
...
@@ -410,13 +408,14 @@ error:
static
void
Close
(
vlc_object_t
*
p_this
)
{
sout_access_out_t
*
p_access
=
(
sout_access_out_t
*
)
p_this
;
sout_access_out_sys_t
*
p_sys
=
p_access
->
p_sys
;
if
(
p_
access
->
p_sys
&&
p_access
->
p_
sys
->
p_shout
)
if
(
p_sys
->
p_shout
)
{
shout_close
(
p_
access
->
p_
sys
->
p_shout
);
shout_close
(
p_sys
->
p_shout
);
shout_shutdown
();
}
free
(
p_
access
->
p_
sys
);
free
(
p_sys
);
msg_Dbg
(
p_access
,
"shout access output closed"
);
}
...
...
@@ -442,15 +441,15 @@ static int Control( sout_access_out_t *p_access, int i_query, va_list args )
*****************************************************************************/
static
ssize_t
Write
(
sout_access_out_t
*
p_access
,
block_t
*
p_buffer
)
{
sout_access_out_sys_t
*
p_sys
=
p_access
->
p_sys
;
size_t
i_write
=
0
;
shout_sync
(
p_
access
->
p_
sys
->
p_shout
);
shout_sync
(
p_sys
->
p_shout
);
while
(
p_buffer
)
{
block_t
*
p_next
=
p_buffer
->
p_next
;
if
(
shout_send
(
p_access
->
p_sys
->
p_shout
,
p_buffer
->
p_buffer
,
p_buffer
->
i_buffer
)
if
(
shout_send
(
p_sys
->
p_shout
,
p_buffer
->
p_buffer
,
p_buffer
->
i_buffer
)
==
SHOUTERR_SUCCESS
)
{
i_write
+=
p_buffer
->
i_buffer
;
...
...
@@ -458,24 +457,24 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
else
{
msg_Err
(
p_access
,
"cannot write to stream: %s"
,
shout_get_error
(
p_access
->
p_sys
->
p_shout
)
);
shout_get_error
(
p_sys
->
p_shout
)
);
/* The most common cause seems to be a server disconnect, resulting in a
Socket Error which can only be fixed by closing and reconnecting.
Since we already began with a working connection, the most feasable
approach to get out of this error status is a (timed) reconnect approach. */
shout_close
(
p_
access
->
p_
sys
->
p_shout
);
shout_close
(
p_sys
->
p_shout
);
msg_Warn
(
p_access
,
"server unavailable? trying to reconnect..."
);
/* Re-open the connection (protocol params have already been set) and re-sync */
if
(
shout_open
(
p_
access
->
p_
sys
->
p_shout
)
==
SHOUTERR_SUCCESS
)
if
(
shout_open
(
p_sys
->
p_shout
)
==
SHOUTERR_SUCCESS
)
{
shout_sync
(
p_
access
->
p_
sys
->
p_shout
);
shout_sync
(
p_sys
->
p_shout
);
msg_Warn
(
p_access
,
"reconnected to server"
);
}
else
{
msg_Err
(
p_access
,
"failed to reconnect to server"
);
block_ChainRelease
(
p_buffer
);
block_ChainRelease
(
p_buffer
);
return
VLC_EGENERIC
;
}
...
...
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