提交 7c054ea7 编写于 作者: P Philip Gladstone

ffserver now runs again (sort of).

* In the test cases, the swf, asf, jpg file formats all work
* The avi case doesn't play in winamp. I suspect that the duration field
  of zero confuses it
* The RM doesn't play. This always was pretty flaky.

Originally committed as revision 3795 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 597c9f2b
......@@ -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, "<ASX Version=\"3\">\r\n");
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<!-- Autogenerated by ffserver -->\r\n");
//q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<!-- Autogenerated by ffserver -->\r\n");
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<ENTRY><REF HREF=\"http://%s/%s%s\"/></ENTRY>\r\n",
hostbuf, filename, info);
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "</ASX>\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;i<c->fmt_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...
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册