ffserver: reflow close_connection()
authorReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Fri, 26 Dec 2014 21:43:40 +0000 (18:43 -0300)
committerReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Fri, 26 Dec 2014 21:44:33 +0000 (18:44 -0300)
Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
ffserver.c

index 7ddacd2..044bf6f 100644 (file)
@@ -836,13 +836,11 @@ static void close_connection(HTTPContext *c)
     ctx = &c->fmt_ctx;
 
     if (!c->last_packet_sent && c->state == HTTPSTATE_SEND_DATA_TRAILER) {
-        if (ctx->oformat) {
-            /* prepare header */
-            if (avio_open_dyn_buf(&ctx->pb) >= 0) {
-                av_write_trailer(ctx);
-                av_freep(&c->pb_buffer);
-                avio_close_dyn_buf(ctx->pb, &c->pb_buffer);
-            }
+        /* prepare header */
+        if (ctx->oformat && avio_open_dyn_buf(&ctx->pb) >= 0) {
+            av_write_trailer(ctx);
+            av_freep(&c->pb_buffer);
+            avio_close_dyn_buf(ctx->pb, &c->pb_buffer);
         }
     }