ffserver: Use AVOption API to access ffm demuxer instead of direct access depending...
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 20 Nov 2015 02:09:28 +0000 (03:09 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 20 Nov 2015 19:03:12 +0000 (20:03 +0100)
server_attached is newly added so the demuxer knows if there is an attached server
that can update the write index. This is needed to fix a infinite loop

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
ffserver.c

index fb8ab7d..7e4f620 100644 (file)
@@ -300,9 +300,9 @@ bail_eio:
 static void ffm_set_write_index(AVFormatContext *s, int64_t pos,
                                 int64_t file_size)
 {
-    FFMContext *ffm = s->priv_data;
-    ffm->write_index = pos;
-    ffm->file_size = file_size;
+    av_opt_set_int(s, "server_attached", 1, AV_OPT_SEARCH_CHILDREN);
+    av_opt_set_int(s, "write_index", pos, AV_OPT_SEARCH_CHILDREN);
+    av_opt_set_int(s, "file_size", file_size, AV_OPT_SEARCH_CHILDREN);
 }
 
 static char *ctime1(char *buf2, size_t buf_size)