* using pixtype as enum - by Philip Gladstone
[ffmpeg.git] / ffserver.c
index 36d0977..4704c51 100644 (file)
@@ -35,7 +35,9 @@
 #include <netdb.h>
 #include <ctype.h>
 #include <signal.h>
+#include <assert.h>
 
+#include "bswap.h" // needed for the bitstream writer in common.h which is included in avformat.h
 #include "avformat.h"
 
 /* maximum number of simultaneous HTTP connections */
@@ -879,8 +881,9 @@ static int http_prepare_data(HTTPContext *c)
                         }
                     }
                 } else {
-                send_it:
-                    av_write_packet(&c->fmt_ctx, &pkt);
+               send_it:
+                    if (av_write_packet(&c->fmt_ctx, &pkt, 0))
+                       c->state = HTTPSTATE_SEND_DATA_TRAILER;
                 }
                 
                 av_free_packet(&pkt);
@@ -1176,6 +1179,13 @@ void add_codec(FFStream *stream, AVCodecContext *av)
             av->width = 160;
             av->height = 128;
         }
+        av->bit_rate_tolerance= 128000;
+        av->qmin= 5;
+        av->qmax= 31;
+        av->qcompress= 0.5;
+        av->qblur= 0.5;
+        av->max_qdiff= 3;
+
         break;
     }