[FFmpeg-devel] [PATCH] matroska : Fix writing packets to a non-seekable AVIOContext

Aaron Colwell acolwell at chromium.org
Wed Mar 7 00:24:41 CET 2012


Hi,

This patch fixes streaming matroska with ffserver. cluster_pos was not
getting set properly which was causing packet writing to fail elsewhere.
All the other code in this method uses pb for writing so I believe the
s->pb here was just a typo.

Aaron

---
 libavformat/matroskaenc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 0b36725..6522273 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1151,7 +1151,7 @@ static int mkv_write_packet_internal(AVFormatContext
*s, AVPacket *pkt)
     }

     if (!mkv->cluster_pos) {
-        mkv->cluster_pos = avio_tell(s->pb);
+        mkv->cluster_pos = avio_tell(pb);
         mkv->cluster = start_ebml_master(pb, MATROSKA_ID_CLUSTER, 0);
         put_ebml_uint(pb, MATROSKA_ID_CLUSTERTIMECODE, FFMAX(0, ts));
         mkv->cluster_pts = FFMAX(0, ts);
-- 
1.7.7.3


More information about the ffmpeg-devel mailing list