diff options
author | Philip Gladstone <philipjsg@users.sourceforge.net> | 2005-01-03 02:42:02 +0000 |
---|---|---|
committer | Philip Gladstone <philipjsg@users.sourceforge.net> | 2005-01-03 02:42:02 +0000 |
commit | 7c054ea7e2f500e42c0df8c2e6815c3e5bfdebb5 (patch) | |
tree | b26e7c84eef7b2fe4d82c0ec5e0f6de599ed86af /ffserver.c | |
parent | 597c9f2bc97107c244ef65f61d39656796c5694c (diff) | |
download | ffmpeg-7c054ea7e2f500e42c0df8c2e6815c3e5bfdebb5.tar.gz |
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
Diffstat (limited to 'ffserver.c')
-rw-r--r-- | ffserver.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ffserver.c b/ffserver.c index c7c7a9f053..6f377860af 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, "<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); } } |