Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
720dffb8
Commit
720dffb8
authored
Dec 08, 2014
by
Reynaldo H. Verdejo Pinochet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffserver_config: reflow add_codec()
Signed-off-by:
Reynaldo H. Verdejo Pinochet
<
reynaldo@osg.samsung.com
>
parent
b4c69b7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
24 deletions
+28
-24
ffserver_config.c
ffserver_config.c
+28
-24
No files found.
ffserver_config.c
View file @
720dffb8
...
...
@@ -195,13 +195,38 @@ static void add_codec(FFServerStream *stream, AVCodecContext *av,
av_dict_copy
(
&
recommended
,
*
opts
,
0
);
av_opt_set_dict2
(
av
->
priv_data
,
opts
,
AV_OPT_SEARCH_CHILDREN
);
av_opt_set_dict2
(
av
,
opts
,
AV_OPT_SEARCH_CHILDREN
);
if
(
av_dict_count
(
*
opts
))
av_log
(
NULL
,
AV_LOG_WARNING
,
"Something is wrong, %d options are not set!
\n
"
,
av_dict_count
(
*
opts
));
if
(
config
->
stream_use_defaults
)
{
//TODO: reident
if
(
!
config
->
stream_use_defaults
)
{
switch
(
av
->
codec_type
)
{
case
AVMEDIA_TYPE_AUDIO
:
if
(
av
->
bit_rate
==
0
)
report_config_error
(
config
->
filename
,
config
->
line_num
,
AV_LOG_ERROR
,
&
config
->
errors
,
"audio bit rate is not set
\n
"
);
if
(
av
->
sample_rate
==
0
)
report_config_error
(
config
->
filename
,
config
->
line_num
,
AV_LOG_ERROR
,
&
config
->
errors
,
"audio sample rate is not set
\n
"
);
break
;
case
AVMEDIA_TYPE_VIDEO
:
if
(
av
->
width
==
0
||
av
->
height
==
0
)
report_config_error
(
config
->
filename
,
config
->
line_num
,
AV_LOG_ERROR
,
&
config
->
errors
,
"video size is not set
\n
"
);
break
;
default:
av_assert0
(
0
);
}
goto
done
;
}
/* stream_use_defaults = true */
/* compute default parameters */
switch
(
av
->
codec_type
)
{
case
AVMEDIA_TYPE_AUDIO
:
...
...
@@ -287,29 +312,8 @@ static void add_codec(FFServerStream *stream, AVCodecContext *av,
default:
abort
();
}
}
else
{
switch
(
av
->
codec_type
)
{
case
AVMEDIA_TYPE_AUDIO
:
if
(
av
->
bit_rate
==
0
)
report_config_error
(
config
->
filename
,
config
->
line_num
,
AV_LOG_ERROR
,
&
config
->
errors
,
"audio bit rate is not set
\n
"
);
if
(
av
->
sample_rate
==
0
)
report_config_error
(
config
->
filename
,
config
->
line_num
,
AV_LOG_ERROR
,
&
config
->
errors
,
"audio sample rate is not set
\n
"
);
break
;
case
AVMEDIA_TYPE_VIDEO
:
if
(
av
->
width
==
0
||
av
->
height
==
0
)
report_config_error
(
config
->
filename
,
config
->
line_num
,
AV_LOG_ERROR
,
&
config
->
errors
,
"video size is not set
\n
"
);
break
;
default:
av_assert0
(
0
);
}
}
done:
st
=
av_mallocz
(
sizeof
(
AVStream
));
if
(
!
st
)
return
;
...
...
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