#include "ffserver.h"
#include "random.h"
+#undef exit
+
/* maximum number of simultaneous HTTP connections */
#define HTTP_MAX_CONNECTIONS 2000
#define IOBUFFER_INIT_SIZE 8192
-/* coef for exponential mean for bitrate estimation in statistics */
-#define AVG_COEF 0.9
-
/* timeouts are in ms */
#define HTTP_REQUEST_TIMEOUT (15 * 1000)
#define RTSP_REQUEST_TIMEOUT (3600 * 24 * 1000)
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "HTTP/1.0 200 OK\r\n");
mime_type = c->stream->fmt->mime_type;
if (!mime_type)
- mime_type = "application/x-octet_stream";
+ mime_type = "application/x-octet-stream";
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Pragma: no-cache\r\n");
/* for asf, we need extra headers */
return 0;
}
-/* in bit/s */
-#define SHORT_TERM_BANDWIDTH 8000000
-
/* should convert the format at the same time */
/* send data starting at c->buffer_ptr to the output connection
(either UDP or TCP connection) */
if (p[0] == 0x00 && p[1] == 0x00 &&
p[2] == 0x01 && p[3] == 0xb6) {
size = p - pkt.data;
- // av_hex_dump(pkt.data, size);
+ // av_hex_dump_log(infile, AV_LOG_DEBUG, pkt.data, size);
st->codec->extradata = av_malloc(size);
st->codec->extradata_size = size;
memcpy(st->codec->extradata, pkt.data, size);
IPAddressACL *nacl = (IPAddressACL *) av_mallocz(sizeof(*nacl));
IPAddressACL **naclp = 0;
+ acl.next = 0;
*nacl = acl;
- nacl->next = 0;
if (stream) {
naclp = &stream->acl;
get_arg(arg, sizeof(arg), &p);
if (stream) {
av_freep(&stream->rtsp_option);
- /* XXX: av_strdup ? */
- stream->rtsp_option = av_malloc(strlen(arg) + 1);
- if (stream->rtsp_option) {
- strcpy(stream->rtsp_option, arg);
- }
+ stream->rtsp_option = av_strdup(arg);
}
} else if (!strcasecmp(cmd, "MulticastAddress")) {
get_arg(arg, sizeof(arg), &p);
return 0;
}
-
-#if 0
-static void write_packet(FFCodec *ffenc,
- uint8_t *buf, int size)
-{
- PacketHeader hdr;
- AVCodecContext *enc = &ffenc->enc;
- uint8_t *wptr;
- mk_header(&hdr, enc, size);
- wptr = http_fifo.wptr;
- fifo_write(&http_fifo, (uint8_t *)&hdr, sizeof(hdr), &wptr);
- fifo_write(&http_fifo, buf, size, &wptr);
- /* atomic modification of wptr */
- http_fifo.wptr = wptr;
- ffenc->data_count += size;
- ffenc->avg_frame_size = ffenc->avg_frame_size * AVG_COEF + size * (1.0 - AVG_COEF);
-}
-#endif
-
static void show_banner(void)
{
printf("ffserver version " FFMPEG_VERSION ", Copyright (c) 2000-2006 Fabrice Bellard, et al.\n");