slash++;
strcpy(slash, "ffmpeg");
- http_log("Launch commandline: ");
- http_log("%s ", pathname);
- for (i = 1; feed->child_argv[i] && feed->child_argv[i][0]; i++)
- http_log("%s ", feed->child_argv[i]);
- http_log("\n");
+ http_log("Launch commandline: ");
+ http_log("%s ", pathname);
+ for (i = 1; feed->child_argv[i] && feed->child_argv[i][0]; i++)
+ http_log("%s ", feed->child_argv[i]);
+ http_log("\n");
for (i = 3; i < 256; i++)
close(i);
start_children(first_feed);
- first_http_ctx = NULL;
- nb_connections = 0;
-
start_multicast();
for(;;) {
if (sf->index != ss->index ||
sf->id != ss->id) {
- printf("Index & Id do not match for stream %d (%s)\n",
+ http_log("Index & Id do not match for stream %d (%s)\n",
i, feed->feed_filename);
matches = 0;
} else {
#define CHECK_CODEC(x) (ccf->x != ccs->x)
if (CHECK_CODEC(codec) || CHECK_CODEC(codec_type)) {
- printf("Codecs do not match for stream %d\n", i);
+ http_log("Codecs do not match for stream %d\n", i);
matches = 0;
} else if (CHECK_CODEC(bit_rate) || CHECK_CODEC(flags)) {
- printf("Codec bitrates do not match for stream %d\n", i);
+ http_log("Codec bitrates do not match for stream %d\n", i);
matches = 0;
} else if (ccf->codec_type == CODEC_TYPE_VIDEO) {
if (CHECK_CODEC(time_base.den) ||
CHECK_CODEC(time_base.num) ||
CHECK_CODEC(width) ||
CHECK_CODEC(height)) {
- printf("Codec width, height and framerate do not match for stream %d\n", i);
+ http_log("Codec width, height and framerate do not match for stream %d\n", i);
matches = 0;
}
} else if (ccf->codec_type == CODEC_TYPE_AUDIO) {
if (CHECK_CODEC(sample_rate) ||
CHECK_CODEC(channels) ||
CHECK_CODEC(frame_size)) {
- printf("Codec sample_rate, channels, frame_size do not match for stream %d\n", i);
+ http_log("Codec sample_rate, channels, frame_size do not match for stream %d\n", i);
matches = 0;
}
} else {
- printf("Unknown codec type\n");
+ http_log("Unknown codec type\n");
matches = 0;
}
}
break;
}
} else
- printf("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);
av_close_input_file(s);
} else
- printf("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);
if (!matches) {
if (feed->readonly) {
- printf("Unable to delete feed file '%s' as it is marked readonly\n",
+ http_log("Unable to delete feed file '%s' as it is marked readonly\n",
feed->feed_filename);
exit(1);
}
AVFormatContext s1, *s = &s1;
if (feed->readonly) {
- printf("Unable to create feed file '%s' as it is marked readonly\n",
+ http_log("Unable to create feed file '%s' as it is marked readonly\n",
feed->feed_filename);
exit(1);
}
const AVOption *o = NULL;
const AVOption *o2 = av_find_opt(avctx, opt, NULL, type, type);
if(o2)
- o = av_set_string(avctx, opt, arg);
+ o = av_set_string2(avctx, opt, arg, 1);
if(!o)
return -1;
return 0;
exit(1);
}
+ /* open log file if needed */
+ if (logfilename[0] != '\0') {
+ if (!strcmp(logfilename, "-"))
+ logfile = stdout;
+ else
+ logfile = fopen(logfilename, "a");
+ av_log_set_callback(http_av_log);
+ }
+
build_file_streams();
build_feed_streams();
/* signal init */
signal(SIGPIPE, SIG_IGN);
- /* open log file if needed */
- if (logfilename[0] != '\0') {
- if (!strcmp(logfilename, "-"))
- logfile = stderr;
- else
- logfile = fopen(logfilename, "a");
- av_log_set_callback(http_av_log);
- }
-
if (ffserver_daemon)
chdir("/");