Index: libmpdemux/muxer_lavf.c =================================================================== --- libmpdemux/muxer_lavf.c (revision 26672) +++ libmpdemux/muxer_lavf.c (working copy) @@ -87,6 +87,21 @@ static offset_t mp_seek(URLContext *h, offset_t pos, int whence) { muxer_t *muxer = (muxer_t*)h->priv_data; + + /* Hack: + * As of ffmpeg r13061, lavf tests seeking to determine if the output + * is streamed. This leads to mp_seek() getting called before + * h->priv_data is set. There's a circular dependency. + * 1. avio.c:url_fopen() calls muxer_lavf.c:mp_seek() + * 2. mp_seek() needs h->priv_data to be set + * 3. ...but h doesn't exist before url_fopen() is called, so + * h->priv_data cannot be set until afterward + * Returning 0 here nullifies lavf's streaming test, but at least it + * avoids segfaulting. + */ + if (! muxer) + return 0; + if(whence == SEEK_CUR) { off_t cur = stream_tell(muxer->stream);