[FFmpeg-devel] [PATCH] fix matroska decoder for streamed input

Reimar Döffinger Reimar.Doeffinger
Sun Jun 6 12:46:46 CEST 2010


On Sat, Jun 05, 2010 at 06:24:40PM +0200, Reimar D?ffinger wrote:
> the matroska demuxer will attempt seeking when reading the seekhead stuff.
> This completely messes up playing from stdin - well, at least within
> MPlayer.
> I since this is a non-essential part, IMO it should be skipped for
> the url_is_streamed case, as in below patch.
> Objections to applying it?

While we're at it, we should also heed the ignidx flag.

Index: libavformat/matroskadec.c
===================================================================
--- libavformat/matroskadec.c   (revision 23501)
+++ libavformat/matroskadec.c   (working copy)
@@ -1063,6 +1063,11 @@
     MatroskaLevel level;
     int i;
 
+    // we should not do any seeking in the streaming case
+    if (url_is_streamed(matroska->ctx->pb) ||
+        (matroska->ctx->flags & AVFMT_FLAG_IGNIDX))
+        return;
+
     for (i=0; i<seekhead_list->nb_elem; i++) {
         int64_t offset = seekhead[i].pos + matroska->segment_start;
 



More information about the ffmpeg-devel mailing list