Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
ec422517
Commit
ec422517
authored
Dec 09, 2014
by
Reynaldo H. Verdejo Pinochet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffserver: reflow start_children()
Signed-off-by:
Reynaldo H. Verdejo Pinochet
<
reynaldo@osg.samsung.com
>
parent
1abdfb10
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
17 deletions
+23
-17
ffserver.c
ffserver.c
+23
-17
No files found.
ffserver.c
View file @
ec422517
...
...
@@ -384,28 +384,17 @@ static int compute_datarate(DataRateData *drd, int64_t count)
static
void
start_children
(
FFServerStream
*
feed
)
{
if
(
no_launch
)
return
;
for
(;
feed
;
feed
=
feed
->
next
)
{
if
(
feed
->
child_argv
&&
!
feed
->
pid
)
{
feed
->
pid_start
=
time
(
0
);
feed
->
pid
=
fork
();
if
(
feed
->
pid
<
0
)
{
http_log
(
"Unable to create children
\n
"
);
exit
(
1
);
}
if
(
!
feed
->
pid
)
{
/* In child */
char
pathname
[
1024
];
char
*
slash
;
int
i
;
if
(
no_launch
)
return
;
/* replace "ffserver" with "ffmpeg" in the path of current
* program. Ignore user provided path */
av_strlcpy
(
pathname
,
my_program_name
,
sizeof
(
pathname
));
slash
=
strrchr
(
pathname
,
'/'
);
if
(
!
slash
)
slash
=
pathname
;
...
...
@@ -413,6 +402,25 @@ static void start_children(FFServerStream *feed)
slash
++
;
strcpy
(
slash
,
"ffmpeg"
);
for
(;
feed
;
feed
=
feed
->
next
)
{
if
(
!
feed
->
child_argv
||
feed
->
pid
)
continue
;
feed
->
pid_start
=
time
(
0
);
feed
->
pid
=
fork
();
if
(
feed
->
pid
<
0
)
{
http_log
(
"Unable to create children
\n
"
);
exit
(
1
);
}
if
(
feed
->
pid
)
continue
;
/* In child */
http_log
(
"Launch command line: "
);
http_log
(
"%s "
,
pathname
);
for
(
i
=
1
;
feed
->
child_argv
[
i
]
&&
feed
->
child_argv
[
i
][
0
];
i
++
)
...
...
@@ -437,8 +445,6 @@ static void start_children(FFServerStream *feed)
_exit
(
1
);
}
}
}
}
/* open a listening socket */
...
...
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