From patchwork Tue Mar 20 07:19:55 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Cernko X-Patchwork-Id: 12446 Received: from intrepid.errror.org ([84.16.235.55] ident=Debian-exim) by www.linuxtv.org with esmtp (Exim 4.50) id 1HTYda-0007FO-ET for vdr@linuxtv.org; Tue, 20 Mar 2007 08:20:06 +0100 Received: from manitu-243.dsl.mpi-sb.mpg.de ([85.116.207.243] helo=[192.168.178.103]) by intrepid.errror.org (envelope-from ) with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63)id 1HTYdV-0003hI-Ty; Tue, 20 Mar 2007 08:20:02 +0100 Message-ID: <45FF8B1B.2020908@errror.org> Date: Tue, 20 Mar 2007 08:19:55 +0100 From: Patrick Cernko User-Agent: Icedove 1.5.0.9 (X11/20070125) MIME-Version: 1.0 To: VDR Mailing List Subject: Re: [vdr] updated slavemode patch for mplayer plugin References: <2d842fa80703031740g711c5a86x482e13610ad79b94@mail.gmail.com> In-Reply-To: <2d842fa80703031740g711c5a86x482e13610ad79b94@mail.gmail.com> X-Enigmail-Version: 0.94.2.0 X-Envelope-To: vdr@linuxtv.org X-Envelope-To: errror@errror.org X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: errror@gmx.de, VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2007 07:20:06 -0000 Status: O X-Status: X-Keywords: X-UID: 12531 Hi List, Stone wrote: > After building the latest SVN today of the mplayer source, I noticed > that the slavemode patch from the vdr-mp3-plugin did not apply anymore. > Here is an attached working version of the patch for current SVN of > mplayer. > seems like the mplayer people are heavily working on their code. Again a slight update to the diff, to make it working. So long, --- mplayer.c (revision 22763) +++ mplayer.c (working copy) @@ -3548,6 +3548,25 @@ edl_decision = 0; } +#if 1 + if(slave_mode){ + float position=0.0; + float time=0.0; + if(mpctx->demuxer->file_format==DEMUXER_TYPE_AVI && mpctx->sh_video->video.dwLength>2) { + // get pos from frame number / total frames + position=(float)mpctx->d_video->pack_no*100.0/(float)mpctx->sh_video->video.dwLength; + } + else { + off_t len = ( mpctx->demuxer->movi_end - mpctx->demuxer->movi_start ); + off_t pos = ( mpctx->demuxer->file_format == DEMUXER_TYPE_AUDIO?mpctx->stream->pos:mpctx->demuxer->filepos ); + if(len>0) position=( pos - mpctx->demuxer->movi_start ) * 100.0 / len; + } + if(mpctx->sh_video) time=mpctx->d_video->pts; + else if(mpctx->sh_audio) time=mpctx->delay; + mp_msg(MSGT_OSD,MSGL_ERR,"SLAVE: time=%.2f position=%.2f\r",time,position); + } +#endif + #ifdef HAVE_NEW_GUI if(use_gui){ guiEventHandling();