Browse code

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

Philip Gladstone authored on 2005/01/03 11:42:02
Showing 1 changed files
... ...
@@ -1354,7 +1354,7 @@ static int http_parse_request(HTTPContext *c)
1354 1354
                         q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: video/x-ms-asf\r\n");
1355 1355
                         q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n");
1356 1356
                         q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<ASX Version=\"3\">\r\n");
1357
-                        q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<!-- Autogenerated by ffserver -->\r\n");
1357
+                        //q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<!-- Autogenerated by ffserver -->\r\n");
1358 1358
                         q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<ENTRY><REF HREF=\"http://%s/%s%s\"/></ENTRY>\r\n", 
1359 1359
                                 hostbuf, filename, info);
1360 1360
                         q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "</ASX>\r\n");
... ...
@@ -1998,15 +1998,18 @@ static int http_prepare_data(HTTPContext *c)
1998 1998
         c->fmt_ctx.nb_streams = c->stream->nb_streams;
1999 1999
         for(i=0;i<c->fmt_ctx.nb_streams;i++) {
2000 2000
             AVStream *st;
2001
+	    AVStream *src;
2001 2002
             st = av_mallocz(sizeof(AVStream));
2002 2003
             c->fmt_ctx.streams[i] = st;
2003 2004
             /* if file or feed, then just take streams from FFStream struct */
2004 2005
             if (!c->stream->feed || 
2005 2006
                 c->stream->feed == c->stream)
2006
-                memcpy(st, c->stream->streams[i], sizeof(AVStream));
2007
+                src = c->stream->streams[i];
2007 2008
             else
2008
-                memcpy(st, c->stream->feed->streams[c->stream->feed_streams[i]],
2009
-                           sizeof(AVStream));
2009
+                src = c->stream->feed->streams[c->stream->feed_streams[i]];
2010
+
2011
+	    *st = *src;
2012
+	    st->priv_data = 0;
2010 2013
             st->codec.frame_number = 0; /* XXX: should be done in
2011 2014
                                            AVStream, not in codec */
2012 2015
             /* I'm pretty sure that this is not correct...
... ...
@@ -3222,6 +3225,7 @@ static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec)
3222 3222
     memcpy(&fst->codec, codec, sizeof(AVCodecContext));
3223 3223
     fst->codec.coded_frame = &dummy_frame;
3224 3224
     fst->index = stream->nb_streams;
3225
+    av_set_pts_info(fst, 33, 1, 90000);
3225 3226
     stream->streams[stream->nb_streams++] = fst;
3226 3227
     return fst;
3227 3228
 }
... ...
@@ -4282,6 +4286,9 @@ static int parse_ffconfig(const char *filename)
4282 4282
                 if (video_id != CODEC_ID_NONE) {
4283 4283
                     video_enc.codec_type = CODEC_TYPE_VIDEO;
4284 4284
                     video_enc.codec_id = video_id;
4285
+		    if (!video_enc.rc_buffer_size) {
4286
+			video_enc.rc_buffer_size = 40 * 1024;
4287
+		    }
4285 4288
                     add_codec(stream, &video_enc);
4286 4289
                 }
4287 4290
             }