Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
c4f54ba8
Commit
c4f54ba8
authored
Nov 07, 2011
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sout_std: try to guess muxer if opening failed
do it not only if muxer was not precised
parent
1575796c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
15 deletions
+25
-15
modules/stream_out/standard.c
modules/stream_out/standard.c
+25
-15
No files found.
modules/stream_out/standard.c
View file @
c4f54ba8
...
...
@@ -210,9 +210,9 @@ static void create_SDP(sout_stream_t *p_stream, sout_access_out_t *p_access)
free
(
dhost
);
}
static
const
char
*
getMuxFrom
Ext
(
const
char
*
psz_url
)
static
const
char
*
getMuxFrom
Alias
(
const
char
*
psz_alias
)
{
static
struct
{
const
char
ext
[
6
];
const
char
mux
[
32
];
}
exttomux
[]
=
static
struct
{
const
char
alias
[
6
];
const
char
mux
[
32
];
}
mux_alias
[]
=
{
{
"avi"
,
"avi"
},
{
"ogg"
,
"ogg"
},
...
...
@@ -238,16 +238,12 @@ static const char *getMuxFromExt( const char *psz_url )
{
"webm"
,
"ffmpeg{mux=webm}"
},
};
if
(
!
psz_
url
)
if
(
!
psz_
alias
)
return
NULL
;
const
char
*
psz_ext
=
strrchr
(
psz_url
,
'.'
);
if
(
!
psz_ext
)
return
NULL
;
psz_ext
++
;
for
(
size_t
i
=
0
;
i
<
sizeof
exttomux
/
sizeof
*
exttomux
;
i
++
)
if
(
!
strcasecmp
(
psz_
ext
,
exttomux
[
i
].
ext
)
)
return
exttomux
[
i
].
mux
;
for
(
size_t
i
=
0
;
i
<
sizeof
mux_alias
/
sizeof
*
mux_alias
;
i
++
)
if
(
!
strcasecmp
(
psz_
alias
,
mux_alias
[
i
].
alias
)
)
return
mux_alias
[
i
].
mux
;
return
NULL
;
}
...
...
@@ -259,7 +255,10 @@ static int fixAccessMux( sout_stream_t *p_stream, char **ppsz_mux,
char
*
psz_access
=
*
ppsz_access
;
if
(
!
psz_mux
)
{
const
char
*
psz_mux_byext
=
getMuxFromExt
(
psz_url
);
const
char
*
psz_ext
=
strrchr
(
psz_url
,
'.'
);
if
(
psz_ext
)
psz_ext
++
;
/* use extension */
const
char
*
psz_mux_byext
=
getMuxFromAlias
(
psz_ext
);
if
(
!
psz_access
)
{
...
...
@@ -393,11 +392,22 @@ static int Open( vlc_object_t *p_this )
p_sys
->
p_mux
=
sout_MuxNew
(
p_sout
,
psz_mux
,
p_access
);
if
(
!
p_sys
->
p_mux
)
{
msg_Err
(
p_stream
,
"no suitable sout mux module for `%s/%s://%s'"
,
psz_access
,
psz_mux
,
psz_url
);
const
char
*
psz_mux_guess
=
getMuxFromAlias
(
psz_mux
);
if
(
psz_mux_guess
&&
strcmp
(
psz_mux_guess
,
psz_mux
)
)
{
msg_Dbg
(
p_stream
,
"Couldn't open mux `%s', trying `%s' instead"
,
psz_mux
,
psz_mux_guess
);
p_sys
->
p_mux
=
sout_MuxNew
(
p_sout
,
psz_mux_guess
,
p_access
);
}
sout_AccessOutDelete
(
p_access
);
goto
end
;
if
(
!
p_sys
->
p_mux
)
{
msg_Err
(
p_stream
,
"no suitable sout mux module for `%s/%s://%s'"
,
psz_access
,
psz_mux
,
psz_url
);
sout_AccessOutDelete
(
p_access
);
goto
end
;
}
}
if
(
var_GetBool
(
p_stream
,
SOUT_CFG_PREFIX
"sap"
)
)
...
...
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