avformat/dashenc: fix for segment open issue when persistent connection is enabled
authorVishwanath Dixit <vdixit@akamai.com>
Fri, 2 Mar 2018 06:22:37 +0000 (11:52 +0530)
committerKarthick Jeyapal <kjeyapal@akamai.com>
Sat, 3 Mar 2018 12:56:44 +0000 (18:26 +0530)
libavformat/dashenc.c

index 83e0cff..489e458 100644 (file)
@@ -1308,7 +1308,7 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt)
         flush_init_segment(s, os);
 
     //open the output context when the first frame of a segment is ready
-    if (!c->single_file && !os->out) {
+    if (!c->single_file && os->packets_written == 1) {
         AVDictionary *opts = NULL;
         const char *proto = avio_find_protocol_name(s->url);
         int use_rename = proto && !strcmp(proto, "file");