|
|
@ -849,7 +849,7 @@ static void close_connection(HTTPContext *c) |
|
|
|
if (st->codec->codec) |
|
|
|
if (st->codec->codec) |
|
|
|
avcodec_close(st->codec); |
|
|
|
avcodec_close(st->codec); |
|
|
|
} |
|
|
|
} |
|
|
|
av_close_input_file(c->fmt_in); |
|
|
|
avformat_close_input(&c->fmt_in); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* free RTP output streams if any */ |
|
|
|
/* free RTP output streams if any */ |
|
|
@ -2169,7 +2169,7 @@ static int open_input_stream(HTTPContext *c, const char *info) |
|
|
|
c->fmt_in = s; |
|
|
|
c->fmt_in = s; |
|
|
|
if (strcmp(s->iformat->name, "ffm") && avformat_find_stream_info(c->fmt_in, NULL) < 0) { |
|
|
|
if (strcmp(s->iformat->name, "ffm") && avformat_find_stream_info(c->fmt_in, NULL) < 0) { |
|
|
|
http_log("Could not find stream info '%s'\n", input_filename); |
|
|
|
http_log("Could not find stream info '%s'\n", input_filename); |
|
|
|
av_close_input_file(s); |
|
|
|
avformat_close_input(&s); |
|
|
|
return -1; |
|
|
|
return -1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2311,8 +2311,7 @@ static int http_prepare_data(HTTPContext *c) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (c->stream->loop) { |
|
|
|
if (c->stream->loop) { |
|
|
|
av_close_input_file(c->fmt_in); |
|
|
|
avformat_close_input(&c->fmt_in); |
|
|
|
c->fmt_in = NULL; |
|
|
|
|
|
|
|
if (open_input_stream(c, "") < 0) |
|
|
|
if (open_input_stream(c, "") < 0) |
|
|
|
goto no_loop; |
|
|
|
goto no_loop; |
|
|
|
goto redo; |
|
|
|
goto redo; |
|
|
@ -2736,7 +2735,7 @@ static int http_receive_data(HTTPContext *c) |
|
|
|
|
|
|
|
|
|
|
|
/* Now we have the actual streams */ |
|
|
|
/* Now we have the actual streams */ |
|
|
|
if (s->nb_streams != feed->nb_streams) { |
|
|
|
if (s->nb_streams != feed->nb_streams) { |
|
|
|
av_close_input_file(s); |
|
|
|
avformat_close_input(&s); |
|
|
|
av_free(pb); |
|
|
|
av_free(pb); |
|
|
|
http_log("Feed '%s' stream number does not match registered feed\n", |
|
|
|
http_log("Feed '%s' stream number does not match registered feed\n", |
|
|
|
c->stream->feed_filename); |
|
|
|
c->stream->feed_filename); |
|
|
@ -2749,7 +2748,7 @@ static int http_receive_data(HTTPContext *c) |
|
|
|
avcodec_copy_context(fst->codec, st->codec); |
|
|
|
avcodec_copy_context(fst->codec, st->codec); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
av_close_input_file(s); |
|
|
|
avformat_close_input(&s); |
|
|
|
av_free(pb); |
|
|
|
av_free(pb); |
|
|
|
} |
|
|
|
} |
|
|
|
c->buffer_ptr = c->buffer; |
|
|
|
c->buffer_ptr = c->buffer; |
|
|
@ -3629,7 +3628,7 @@ static void build_file_streams(void) |
|
|
|
if (avformat_find_stream_info(infile, NULL) < 0) { |
|
|
|
if (avformat_find_stream_info(infile, NULL) < 0) { |
|
|
|
http_log("Could not find codec parameters from '%s'\n", |
|
|
|
http_log("Could not find codec parameters from '%s'\n", |
|
|
|
stream->feed_filename); |
|
|
|
stream->feed_filename); |
|
|
|
av_close_input_file(infile); |
|
|
|
avformat_close_input(&infile); |
|
|
|
goto fail; |
|
|
|
goto fail; |
|
|
|
} |
|
|
|
} |
|
|
|
extract_mpeg4_header(infile); |
|
|
|
extract_mpeg4_header(infile); |
|
|
@ -3637,7 +3636,7 @@ static void build_file_streams(void) |
|
|
|
for(i=0;i<infile->nb_streams;i++) |
|
|
|
for(i=0;i<infile->nb_streams;i++) |
|
|
|
add_av_stream1(stream, infile->streams[i]->codec, 1); |
|
|
|
add_av_stream1(stream, infile->streams[i]->codec, 1); |
|
|
|
|
|
|
|
|
|
|
|
av_close_input_file(infile); |
|
|
|
avformat_close_input(&infile); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -3727,7 +3726,7 @@ static void build_feed_streams(void) |
|
|
|
http_log("Deleting feed file '%s' as stream counts differ (%d != %d)\n", |
|
|
|
http_log("Deleting feed file '%s' as stream counts differ (%d != %d)\n", |
|
|
|
feed->feed_filename, s->nb_streams, feed->nb_streams); |
|
|
|
feed->feed_filename, s->nb_streams, feed->nb_streams); |
|
|
|
|
|
|
|
|
|
|
|
av_close_input_file(s); |
|
|
|
avformat_close_input(&s); |
|
|
|
} else |
|
|
|
} else |
|
|
|
http_log("Deleting feed file '%s' as it appears to be corrupt\n", |
|
|
|
http_log("Deleting feed file '%s' as it appears to be corrupt\n", |
|
|
|
feed->feed_filename); |
|
|
|
feed->feed_filename); |
|
|
|