changeset 2514:959cec4fc0c2 libavformat

Don't seek when streamed
author conrad
date Wed, 05 Sep 2007 00:26:00 +0000
parents c4413ad376b9
children 0b8c1ddfa711
files matroskaenc.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/matroskaenc.c	Wed Sep 05 00:25:58 2007 +0000
+++ b/matroskaenc.c	Wed Sep 05 00:26:00 2007 +0000
@@ -215,6 +215,10 @@
 {
     offset_t pos = url_ftell(pb);
 
+    // leave the unknown size for masters when streaming
+    if (url_is_streamed(pb))
+        return;
+
     url_fseek(pb, master.pos - master.sizebytes, SEEK_SET);
     put_ebml_size(pb, pos - master.pos, master.sizebytes);
     url_fseek(pb, pos, SEEK_SET);
@@ -767,6 +771,7 @@
 
     end_ebml_master(pb, mkv->cluster);
 
+    if (!url_is_streamed(pb)) {
     cuespos = mkv_write_cues(pb, mkv->cues, s->nb_streams);
     second_seekhead = mkv_write_seekhead(pb, mkv->cluster_seekhead);
 
@@ -790,6 +795,7 @@
         put_ebml_binary(pb, MATROSKA_ID_SEGMENTUID, segment_uid, 16);
     }
     url_fseek(pb, currentpos, SEEK_SET);
+    }
 
     end_ebml_master(pb, mkv->segment);
     av_free(mkv->md5_ctx);