]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavformat/ffmenc.c
frsh: Export information about the last RTP contract and VRES
[frescor/ffmpeg.git] / libavformat / ffmenc.c
index 1e78306b7d3c378d05b39d78187186436b8e88b7..3de4984dfebc41b064073c95ae852de2bf908a45 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * FFM (ffserver live feed) muxer
- * Copyright (c) 2001 Fabrice Bellard.
+ * Copyright (c) 2001 Fabrice Bellard
  *
  * This file is part of FFmpeg.
  *
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/intreadwrite.h"
 #include "avformat.h"
 #include "ffm.h"
 
@@ -92,8 +93,7 @@ static int ffm_write_header(AVFormatContext *s)
     /* header */
     put_le32(pb, MKTAG('F', 'F', 'M', '1'));
     put_be32(pb, ffm->packet_size);
-    /* XXX: store write position in other file ? */
-    put_be64(pb, ffm->packet_size); /* current write position */
+    put_be64(pb, 0); /* current write position */
 
     put_be32(pb, s->nb_streams);
     bit_rate = 0;
@@ -132,7 +132,7 @@ static int ffm_write_header(AVFormatContext *s)
             put_be16(pb, (int) (codec->qcompress * 10000.0));
             put_be16(pb, (int) (codec->qblur * 10000.0));
             put_be32(pb, codec->bit_rate_tolerance);
-            put_strz(pb, codec->rc_eq);
+            put_strz(pb, codec->rc_eq ? codec->rc_eq : "tex^qComp");
             put_be32(pb, codec->rc_max_rate);
             put_be32(pb, codec->rc_min_rate);
             put_be32(pb, codec->rc_buffer_size);
@@ -223,21 +223,12 @@ static int ffm_write_trailer(AVFormatContext *s)
 
     put_flush_packet(pb);
 
-    if (!url_is_streamed(pb)) {
-        int64_t size;
-        /* update the write offset */
-        size = url_ftell(pb);
-        url_fseek(pb, 8, SEEK_SET);
-        put_be64(pb, size);
-        put_flush_packet(pb);
-    }
-
     return 0;
 }
 
 AVOutputFormat ffm_muxer = {
     "ffm",
-    NULL_IF_CONFIG_SMALL("ffm format"),
+    NULL_IF_CONFIG_SMALL("FFM (FFserver live feed) format"),
     "",
     "ffm",
     sizeof(FFMContext),