X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffserver.c;h=6f377860af619842796cf926d5c23b7bb209c294;hb=7c054ea7e2f500e42c0df8c2e6815c3e5bfdebb5;hp=b6d9905a02b44d4865f42a07e60e352a9468cc89;hpb=668fe04e39391d88216985742f747432526d7707;p=ffmpeg diff --git a/ffserver.c b/ffserver.c index b6d9905a02b..6f377860af6 100644 --- a/ffserver.c +++ b/ffserver.c @@ -1354,7 +1354,7 @@ static int http_parse_request(HTTPContext *c) q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: video/x-ms-asf\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); - q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); + //q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n", hostbuf, filename, info); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); @@ -1998,15 +1998,18 @@ static int http_prepare_data(HTTPContext *c) c->fmt_ctx.nb_streams = c->stream->nb_streams; for(i=0;ifmt_ctx.nb_streams;i++) { AVStream *st; + AVStream *src; st = av_mallocz(sizeof(AVStream)); c->fmt_ctx.streams[i] = st; /* if file or feed, then just take streams from FFStream struct */ if (!c->stream->feed || c->stream->feed == c->stream) - memcpy(st, c->stream->streams[i], sizeof(AVStream)); + src = c->stream->streams[i]; else - memcpy(st, c->stream->feed->streams[c->stream->feed_streams[i]], - sizeof(AVStream)); + src = c->stream->feed->streams[c->stream->feed_streams[i]]; + + *st = *src; + st->priv_data = 0; st->codec.frame_number = 0; /* XXX: should be done in AVStream, not in codec */ /* I'm pretty sure that this is not correct... @@ -2714,7 +2717,7 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url) struct sockaddr_in my_addr; /* find which url is asked */ - url_split(NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url); + url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url); path = path1; if (*path == '/') path++; @@ -2788,7 +2791,7 @@ static void rtsp_cmd_setup(HTTPContext *c, const char *url, RTSPActionServerSetup setup; /* find which url is asked */ - url_split(NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url); + url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url); path = path1; if (*path == '/') path++; @@ -2943,7 +2946,7 @@ static HTTPContext *find_rtp_session_with_url(const char *url, return NULL; /* find which url is asked */ - url_split(NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url); + url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url); path = path1; if (*path == '/') path++; @@ -3222,6 +3225,7 @@ static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec) memcpy(&fst->codec, codec, sizeof(AVCodecContext)); fst->codec.coded_frame = &dummy_frame; fst->index = stream->nb_streams; + av_set_pts_info(fst, 33, 1, 90000); stream->streams[stream->nb_streams++] = fst; return fst; } @@ -4282,6 +4286,9 @@ static int parse_ffconfig(const char *filename) if (video_id != CODEC_ID_NONE) { video_enc.codec_type = CODEC_TYPE_VIDEO; video_enc.codec_id = video_id; + if (!video_enc.rc_buffer_size) { + video_enc.rc_buffer_size = 40 * 1024; + } add_codec(stream, &video_enc); } }