]> git.sesse.net Git - ffmpeg/blobdiff - ffserver.c
only write trailer when state says so, should fix issue #646
[ffmpeg] / ffserver.c
index 24b78c8e5ececfba5e3af2b570e091a553b57f93..c91bd640991d29fb71897ce186b51c9623d5f5c3 100644 (file)
@@ -796,7 +796,7 @@ static void close_connection(HTTPContext *c)
 
     ctx = &c->fmt_ctx;
 
-    if (!c->last_packet_sent) {
+    if (!c->last_packet_sent && c->state == HTTPSTATE_SEND_DATA_TRAILER) {
         if (ctx->oformat) {
             /* prepare header */
             if (url_open_dyn_buf(&ctx->pb) >= 0) {