1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

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
This commit is contained in:
Philip Gladstone 2005-01-03 02:42:02 +00:00
parent 597c9f2bc9
commit 7c054ea7e2

View File

@ -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, "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, "<ASX Version=\"3\">\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", q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<ENTRY><REF HREF=\"http://%s/%s%s\"/></ENTRY>\r\n",
hostbuf, filename, info); hostbuf, filename, info);
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "</ASX>\r\n"); 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; c->fmt_ctx.nb_streams = c->stream->nb_streams;
for(i=0;i<c->fmt_ctx.nb_streams;i++) { for(i=0;i<c->fmt_ctx.nb_streams;i++) {
AVStream *st; AVStream *st;
AVStream *src;
st = av_mallocz(sizeof(AVStream)); st = av_mallocz(sizeof(AVStream));
c->fmt_ctx.streams[i] = st; c->fmt_ctx.streams[i] = st;
/* if file or feed, then just take streams from FFStream struct */ /* if file or feed, then just take streams from FFStream struct */
if (!c->stream->feed || if (!c->stream->feed ||
c->stream->feed == c->stream) c->stream->feed == c->stream)
memcpy(st, c->stream->streams[i], sizeof(AVStream)); src = c->stream->streams[i];
else else
memcpy(st, c->stream->feed->streams[c->stream->feed_streams[i]], src = c->stream->feed->streams[c->stream->feed_streams[i]];
sizeof(AVStream));
*st = *src;
st->priv_data = 0;
st->codec.frame_number = 0; /* XXX: should be done in st->codec.frame_number = 0; /* XXX: should be done in
AVStream, not in codec */ AVStream, not in codec */
/* I'm pretty sure that this is not correct... /* 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)); memcpy(&fst->codec, codec, sizeof(AVCodecContext));
fst->codec.coded_frame = &dummy_frame; fst->codec.coded_frame = &dummy_frame;
fst->index = stream->nb_streams; fst->index = stream->nb_streams;
av_set_pts_info(fst, 33, 1, 90000);
stream->streams[stream->nb_streams++] = fst; stream->streams[stream->nb_streams++] = fst;
return fst; return fst;
} }
@ -4282,6 +4286,9 @@ static int parse_ffconfig(const char *filename)
if (video_id != CODEC_ID_NONE) { if (video_id != CODEC_ID_NONE) {
video_enc.codec_type = CODEC_TYPE_VIDEO; video_enc.codec_type = CODEC_TYPE_VIDEO;
video_enc.codec_id = video_id; video_enc.codec_id = video_id;
if (!video_enc.rc_buffer_size) {
video_enc.rc_buffer_size = 40 * 1024;
}
add_codec(stream, &video_enc); add_codec(stream, &video_enc);
} }
} }