mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
ffserver: refactor build_file_streams()
Avoid unneeded nesting, drop redundant var Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
This commit is contained in:
parent
532a283383
commit
4ba148a6ea
23
ffserver.c
23
ffserver.c
@ -3567,23 +3567,26 @@ static void extract_mpeg4_header(AVFormatContext *infile)
|
||||
/* compute the needed AVStream for each file */
|
||||
static void build_file_streams(void)
|
||||
{
|
||||
FFServerStream *stream, *stream_next;
|
||||
FFServerStream *stream;
|
||||
AVFormatContext *infile;
|
||||
int i, ret;
|
||||
|
||||
/* gather all streams */
|
||||
for(stream = config.first_stream; stream; stream = stream_next) {
|
||||
AVFormatContext *infile = NULL;
|
||||
stream_next = stream->next;
|
||||
if (stream->stream_type == STREAM_TYPE_LIVE &&
|
||||
!stream->feed) {
|
||||
for(stream = config.first_stream; stream; stream = stream->next) {
|
||||
infile = NULL;
|
||||
|
||||
if (stream->stream_type != STREAM_TYPE_LIVE || stream->feed)
|
||||
continue;
|
||||
|
||||
/* the stream comes from a file */
|
||||
/* try to open the file */
|
||||
/* open stream */
|
||||
if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
|
||||
/* specific case : if transport stream output to RTP,
|
||||
|
||||
|
||||
/* specific case: if transport stream output to RTP,
|
||||
* we use a raw transport stream reader */
|
||||
if (stream->fmt && !strcmp(stream->fmt->name, "rtp"))
|
||||
av_dict_set(&stream->in_opts, "mpeg2ts_compute_pcr", "1", 0);
|
||||
}
|
||||
|
||||
if (!stream->feed_filename[0]) {
|
||||
http_log("Unspecified feed file for stream '%s'\n",
|
||||
@ -3593,6 +3596,7 @@ static void build_file_streams(void)
|
||||
|
||||
http_log("Opening feed file '%s' for stream '%s'\n",
|
||||
stream->feed_filename, stream->filename);
|
||||
|
||||
ret = avformat_open_input(&infile, stream->feed_filename,
|
||||
stream->ifmt, &stream->in_opts);
|
||||
if (ret < 0) {
|
||||
@ -3618,7 +3622,6 @@ static void build_file_streams(void)
|
||||
avformat_close_input(&infile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* compute the needed AVStream for each feed */
|
||||
|
Loading…
Reference in New Issue
Block a user