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
0124fca0
Commit
0124fca0
authored
Nov 28, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffserver: extend feedback in http_start_receive_data()
parent
d2e46b11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
11 deletions
+24
-11
ffserver.c
ffserver.c
+24
-11
No files found.
ffserver.c
View file @
0124fca0
...
...
@@ -2622,19 +2622,26 @@ static int http_send_data(HTTPContext *c)
static
int
http_start_receive_data
(
HTTPContext
*
c
)
{
int
fd
;
int
ret
;
if
(
c
->
stream
->
feed_opened
)
return
-
1
;
if
(
c
->
stream
->
feed_opened
)
{
http_log
(
"Stream feed '%s' was not opened
\n
"
,
c
->
stream
->
feed_filename
);
return
AVERROR
(
EINVAL
);
}
/* Don't permit writing to this one */
if
(
c
->
stream
->
readonly
)
return
-
1
;
if
(
c
->
stream
->
readonly
)
{
http_log
(
"Cannot write to read-only file '%s'
\n
"
,
c
->
stream
->
feed_filename
);
return
AVERROR
(
EINVAL
);
}
/* open feed */
fd
=
open
(
c
->
stream
->
feed_filename
,
O_RDWR
);
if
(
fd
<
0
)
{
http_log
(
"Error opening feeder file: %s
\n
"
,
strerror
(
errno
));
return
-
1
;
ret
=
AVERROR
(
errno
);
http_log
(
"Could not open feed file '%s':%s
\n
"
,
c
->
stream
->
feed_filename
,
strerror
(
errno
));
return
ret
;
}
c
->
feed_fd
=
fd
;
...
...
@@ -2643,13 +2650,19 @@ static int http_start_receive_data(HTTPContext *c)
ffm_write_write_index
(
c
->
feed_fd
,
FFM_PACKET_SIZE
);
http_log
(
"Truncating feed file '%s'
\n
"
,
c
->
stream
->
feed_filename
);
if
(
ftruncate
(
c
->
feed_fd
,
FFM_PACKET_SIZE
)
<
0
)
{
http_log
(
"Error truncating feed file: %s
\n
"
,
strerror
(
errno
));
return
-
1
;
ret
=
AVERROR
(
errno
);
http_log
(
"Error truncating feed file '%s': %s
\n
"
,
c
->
stream
->
feed_filename
,
strerror
(
errno
));
return
ret
;
}
}
else
{
if
((
c
->
stream
->
feed_write_index
=
ffm_read_write_index
(
fd
))
<
0
)
{
http_log
(
"Error reading write index from feed file: %s
\n
"
,
strerror
(
errno
));
return
-
1
;
ret
=
ffm_read_write_index
(
fd
);
if
(
ret
<
0
)
{
http_log
(
"Error reading write index from feed file '%s': %s
\n
"
,
c
->
stream
->
feed_filename
,
strerror
(
errno
));
return
ret
;
}
else
{
c
->
stream
->
feed_write_index
=
ret
;
}
}
...
...
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