From patchwork Wed May 18 01:16:50 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "C.Y.M" X-Patchwork-Id: 11885 Received: from zproxy.gmail.com ([64.233.162.195]) by www.linuxtv.org with esmtp (Exim 4.34) id 1DYDBp-000194-DI for vdr@linuxtv.org; Wed, 18 May 2005 03:17:38 +0200 Received: by zproxy.gmail.com with SMTP id 16so2650796nzp for ; Tue, 17 May 2005 18:17:04 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:disposition-notification-to:date:reply-to:organization:user-agent:x-accept-language:mime-version:to:subject:x-enigmail-version:x-enigmail-supports:content-type:from; b=OEVYFy9rnYzKF79FFPNeO2XN5gGMls8bPu88j8TKh+bimcBwHXIw7l11BZJ5VaBaxML0alXznprYcEFWpEJZac5ocq/wkfMVvRDCvI3uxkQizV6XU0Gsjw2wD5r6shYsxRzRLThL7z/YR8wTQyCQLahpgh4Jpp+mve1D0Ed+bCk= Received: by 10.36.120.12 with SMTP id s12mr467916nzc; Tue, 17 May 2005 18:17:04 -0700 (PDT) Received: from nofear.bounceme.net ([4.246.60.43]) by mx.gmail.com with ESMTP id 10sm801752nzo.2005.05.17.18.16.58; Tue, 17 May 2005 18:17:04 -0700 (PDT) Received: from [10.1.1.66] (hades [10.1.1.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by nofear.bounceme.net (Postfix) with ESMTP id E0B2E73534 for ; Tue, 17 May 2005 18:16:52 -0700 (PDT) Message-ID: <428A9782.8090808@syphir.sytes.net> Date: Tue, 17 May 2005 18:16:50 -0700 Organization: CooLNeT User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Vdr X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime From: "C.Y.M" Subject: [vdr] [Fwd: [MPlayer-dev-eng] [PATCH] get_time_pos slave commando] X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: syphir@syphir.sytes.net, Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2005 01:17:38 -0000 Status: O X-Status: X-Keywords: X-UID: 2298 Would this new addition to mplayer help show the proper position of native .vdr files in the mplayer plugin? Best Regards, Hi, I think this would be useful addition to slave mode, especially external Guis sure could need this IMHO. If nobody objects I intend to apply tomorrow. Greetings, Reimar Döffinger Index: mplayer.c =================================================================== RCS file: /cvsroot/mplayer/main/mplayer.c,v retrieving revision 1.844 diff -u -r1.844 mplayer.c --- mplayer.c 29 Apr 2005 10:48:32 -0000 1.844 +++ mplayer.c 17 May 2005 19:22:40 -0000 @@ -3503,6 +3503,15 @@ case MP_CMD_GET_PERCENT_POS : { mp_msg(MSGT_GLOBAL,MSGL_INFO,MSGTR_AnsPercentPos, demuxer_get_percent_pos(demuxer)); } break; + case MP_CMD_GET_TIME_POS : { + float pos = 0; + if (sh_video) + pos = sh_video->pts; + else + if (sh_audio && audio_out) + pos = sh_audio->delay - audio_out->get_delay() * playback_speed; + mp_msg(MSGT_GLOBAL, MSGL_INFO, MSGTR_AnsTimePos, pos); + } break; case MP_CMD_SWITCH_AUDIO : { int v = demuxer_switch_audio(demuxer, cmd->args[0].v.i); if (identify) Index: DOCS/tech/slave.txt =================================================================== RCS file: /cvsroot/mplayer/main/DOCS/tech/slave.txt,v retrieving revision 1.37 diff -u -r1.37 slave.txt --- DOCS/tech/slave.txt 28 Apr 2005 14:43:17 -0000 1.37 +++ DOCS/tech/slave.txt 17 May 2005 19:22:42 -0000 @@ -132,6 +132,9 @@ get_percent_pos Print out the current position in the file, as integer percentage [0-100). +get_time_pos + Print out the current position in the filein seconds, as float. + get_time_length Print out the length of the current file in seconds. Index: help/help_mp-en.h =================================================================== RCS file: /cvsroot/mplayer/main/help/help_mp-en.h,v retrieving revision 1.167 diff -u -r1.167 help_mp-en.h --- help/help_mp-en.h 19 Mar 2005 17:28:57 -0000 1.167 +++ help/help_mp-en.h 17 May 2005 19:22:57 -0000 @@ -172,6 +172,7 @@ #define MSGTR_AnsLength "ANS_LENGTH=%ld\n" #define MSGTR_AnsVoFullscreen "ANS_VO_FULLSCREEN=%ld\n" #define MSGTR_AnsPercentPos "ANS_PERCENT_POSITION=%ld\n" +#define MSGTR_AnsTimePos "ANS_TIME_POSITION=%.1f\n" #define MSGTR_DvdnavNullEvent "DVDNAV Event NULL?!\n" #define MSGTR_DvdnavHighlightEventBroken "DVDNAV Event: Highlight event broken\n" #define MSGTR_DvdnavEvent "DVDNAV Event: %s\n" Index: input/input.c =================================================================== RCS file: /cvsroot/mplayer/main/input/input.c,v retrieving revision 1.115 diff -u -r1.115 input.c --- input/input.c 28 Apr 2005 14:43:18 -0000 1.115 +++ input/input.c 17 May 2005 19:23:03 -0000 @@ -81,6 +81,7 @@ { MP_CMD_SUB_SELECT, "sub_select", 0, { { MP_CMD_ARG_INT,{-2} }, {-1,{0}} } }, { MP_CMD_SUB_LOG, "sub_log", 0, { {-1,{0}} } }, { MP_CMD_GET_PERCENT_POS, "get_percent_pos", 0, { {-1,{0}} } }, + { MP_CMD_GET_TIME_POS, "get_time_pos", 0, { {-1,{0}} } }, { MP_CMD_GET_TIME_LENGTH, "get_time_length", 0, { {-1,{0}} } }, { MP_CMD_SWITCH_AUDIO, "switch_audio", 0, { { MP_CMD_ARG_INT,{-1} }, {-1,{0}} } }, #ifdef USE_TV Index: input/input.h =================================================================== RCS file: /cvsroot/mplayer/main/input/input.h,v retrieving revision 1.54 diff -u -r1.54 input.h --- input/input.h 3 Apr 2005 14:08:26 -0000 1.54 +++ input/input.h 17 May 2005 19:23:04 -0000 @@ -64,6 +64,7 @@ #define MP_CMD_RUN 60 #define MP_CMD_SUB_LOG 61 #define MP_CMD_SWITCH_AUDIO 62 +#define MP_CMD_GET_TIME_POS 63 #define MP_CMD_GUI_EVENTS 5000 #define MP_CMD_GUI_LOADFILE 5001