--- AUTHORS 2004-10-08 22:08:11.000000000 +0200 +++ AUTHORS 2004-10-13 19:32:33.547035933 +0200 @@ -523,6 +523,9 @@ * various docs updates and fixes * 1st half of the documentation HTML --> XML conversion +Mueller, Steven + * first implementation of live changing playback speed + MPlayerPL - Polish MPlayer Translation Team (http://mplayerpl.emdej.com) * Waclaw Schiller (Torinthiel) * Kuba Misiorny (Qba) @@ -623,6 +626,10 @@ Schneider, Florian * RealVideo codec libraries interface, .rm demuxer fixes +Scherthan, Frank + * updated live changing playback speed to latest CVS + * adding OSD handling for live changing playback speed + Schoenbrunner, Oliver * SGI audio driver * MIPS support --- DOCS/man/de/mplayer.1 2004-09-24 21:27:23.000000000 +0200 +++ DOCS/man/de/mplayer.1 2004-10-13 19:32:33.573033201 +0200 @@ -227,6 +227,12 @@ Springe 1 Minute zurück/\:vor. .IPs "BildHoch und BildRunter (bzw.\& PGUP/\:PGDOWN)" Springe 10 Minuten zurück/\:vor. +.IPs "[ und ]" +Verringert/erhöht die Abspielgeschwindigkeit um 10%. +.IPs "{ und }" +Halbiert/verdoppelt die Abspielgeschwindigkeit. +.IPs "Löschen (Backspace)" +Setzt die Abspielgeschwindigkeit zurück. .IPs "< und >" zurück\:vor in der Playlist .IPs "Pos1 und Ende" --- DOCS/man/en/mplayer.1 2004-10-13 01:10:48.000000000 +0200 +++ DOCS/man/en/mplayer.1 2004-10-13 19:32:33.587031730 +0200 @@ -219,6 +219,12 @@ Seek backward/\:forward 1 minute. .IPs "pgup and pgdown" Seek backward/\:forward 10 minutes. +.IPs "[ and ]" +Decreases/increases current playback speed by 10%. +.IPs "{ and }" +Halves/doubles current playback speed. +.IPs "Backspace" +Reset playback speed to normal. .IPs "< and >" backward/\:forward in playlist .IPs "HOME and END" --- DOCS/tech/slave.txt 2004-10-13 18:48:13.347594078 +0200 +++ DOCS/tech/slave.txt 2004-10-13 19:32:33.590031415 +0200 @@ -15,6 +15,15 @@ 1 is a seek to % in the movie. 2 is a seek to an absolute position of seconds. +speed_set + Set the speed to . + +speed_incr + Add to the current playback speed. + +speed_mult + Multiply the current speed with . + edl_mark ??? --- DOCS/xml/en/usage.xml 2004-07-16 21:31:05.000000000 +0200 +++ DOCS/xml/en/usage.xml 2004-10-13 19:32:33.593031100 +0200 @@ -221,6 +221,18 @@ Type 0 is a relative seek of +/- val seconds. Type 1 seek to val % in the movie. +speed_mult (float) val + + Multiply the current speed with val. + +speed_incr (float) val + + Add val to the current playback speed. + +speed_set (float) val + + Set the speed to val. + audio_delay (float) val Adjust the audio delay of val seconds --- etc/input.conf 2004-10-13 01:09:58.000000000 +0200 +++ etc/input.conf 2004-10-13 19:32:33.594030995 +0200 @@ -15,6 +15,11 @@ PGDWN seek -600 - audio_delay 0.100 + audio_delay -0.100 +[ speed_mult 0.9091 # scale playback speed +] speed_mult 1.1 +{ speed_mult 0.5 +} speed_mult 2.0 +BS speed_set 1.0 # reset speed to normal q quit ESC quit ENTER pt_step 1 1 --- input/input.c 2004-10-13 01:10:01.000000000 +0200 +++ input/input.c 2004-10-13 19:35:41.780254661 +0200 @@ -55,6 +55,9 @@ { MP_CMD_EDL_MARK, "edl_mark", 0, { {-1,{0}} } }, #endif { MP_CMD_AUDIO_DELAY, "audio_delay", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } }, + { MP_CMD_SPEED_INCR, "speed_incr", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } }, + { MP_CMD_SPEED_MULT, "speed_mult", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } }, + { MP_CMD_SPEED_SET, "speed_set", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } }, { MP_CMD_QUIT, "quit", 0, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, { MP_CMD_PAUSE, "pause", 0, { {-1,{0}} } }, { MP_CMD_FRAME_STEP, "frame_step", 0, { {-1,{0}} } }, @@ -270,6 +273,11 @@ { { KEY_PAGE_DOWN, 0 }, "seek -600" }, { { '-', 0 }, "audio_delay 0.100" }, { { '+', 0 }, "audio_delay -0.100" }, + { { '[', 0 }, "speed_mult 0.9091" }, + { { ']', 0 }, "speed_mult 1.1" }, + { { '{', 0 }, "speed_mult 0.5" }, + { { '}', 0 }, "speed_mult 2.0" }, + { { KEY_BACKSPACE, 0 }, "speed_set 1.0" }, { { 'q', 0 }, "quit" }, { { KEY_ESC, 0 }, "quit" }, #ifndef HAVE_NEW_GUI --- input/input.h 2004-10-13 01:10:02.000000000 +0200 +++ input/input.h 2004-10-13 19:34:53.662311336 +0200 @@ -58,6 +58,9 @@ #define MP_CMD_SWITCH_VSYNC 54 #define MP_CMD_SWITCH_RATIO 55 #define MP_CMD_FRAME_STEP 56 +#define MP_CMD_SPEED_INCR 57 +#define MP_CMD_SPEED_MULT 58 +#define MP_CMD_SPEED_SET 59 #define MP_CMD_GUI_EVENTS 5000 #define MP_CMD_GUI_LOADFILE 5001 --- mplayer.c 2004-10-13 01:09:44.000000000 +0200 +++ mplayer.c 2004-10-13 19:36:21.745054794 +0200 @@ -756,6 +756,31 @@ #include #endif +// reinit to get the audio scaled to a new playback_speed +void reinit_audio_speed(sh_audio_t *sh_audio, ao_functions_t *audio_out, ao_data_t *ao_data) +{ + if(sh_audio) { + audio_out->pause(); + audio_out->reset(); // stop audio, throwing away buffered data + audio_out->uninit(0); + ao_data->samplerate=force_srate?force_srate:sh_audio->samplerate*playback_speed; + audio_out->init(ao_data->samplerate, + audio_output_channels?audio_output_channels:ao_data->channels, + audio_output_format?audio_output_format:ao_data->format,0); + // rel_seek_secs-= 0.01; // causes bad behavior on media with keyframes + resync_audio_stream(sh_audio); + audio_out->resume(); + } +} + +// return the closest acceptable speed to that requested +float bound_play_speed(float requested_speed) +{ + if( requested_speed < 0.05 ) return 0.05; //lower speed results in bad response! + else if( requested_speed > 4.0 ) return 4.0; //alsa can't handle higher speeds! + else return requested_speed; +} + int main(int argc,char* argv[]){ @@ -776,6 +801,7 @@ int osd_last_pts=-303; int osd_show_av_delay = 0; int osd_show_text = 0; +int osd_show_speed = 0; int osd_show_sub_delay = 0; int osd_show_sub_pos = 0; int osd_show_sub_visibility = 0; @@ -2385,7 +2411,7 @@ else max_pts_correction=sh_video->frametime*0.10; // +-10% of time if(!frame_time_remaining){ sh_audio->delay+=x; c_total+=x;} // correction - if(!quiet) mp_msg(MSGT_AVSYNC,MSGL_STATUS,"A:%6.1f V:%6.1f A-V:%7.3f ct:%7.3f %3d/%3d %2d%% %2d%% %4.1f%% %d %d %d%%\r", + if(!quiet) mp_msg(MSGT_AVSYNC,MSGL_STATUS,"A:%6.1f V:%6.1f A-V:%7.3f ct:%7.3f %3d/%3d %2d%% %2d%% %4.1f%% %d %d %d%% %4.2fx\r", a_pts-audio_delay-delay,v_pts,AV_delay,c_total, (int)sh_video->num_frames,(int)sh_video->num_frames_decoded, (sh_video->timer>0.5)?(int)(100.0*video_time_usage*playback_speed/(double)sh_video->timer):0, @@ -2394,6 +2420,7 @@ ,drop_frame_cnt ,output_quality ,cache_fill_status + ,playback_speed ); fflush(stdout); } @@ -2597,6 +2624,24 @@ osd_show_av_delay = 9; if(sh_audio) sh_audio->delay+= v; } break; + case MP_CMD_SPEED_INCR : { + float v = cmd->args[0].v.f; + playback_speed = bound_play_speed(playback_speed + v); + osd_show_speed = sh_video->fps; + reinit_audio_speed(sh_audio, audio_out, &ao_data); + } break; + case MP_CMD_SPEED_MULT : { + float v = cmd->args[0].v.f; + playback_speed = bound_play_speed(playback_speed * v); + osd_show_speed = sh_video->fps; + reinit_audio_speed(sh_audio, audio_out, &ao_data); + } break; + case MP_CMD_SPEED_SET : { + float v = cmd->args[0].v.f; + playback_speed = bound_play_speed(v); + osd_show_speed = sh_video->fps; + reinit_audio_speed(sh_audio, audio_out, &ao_data); + } break; case MP_CMD_FRAME_STEP : case MP_CMD_PAUSE : { osd_function=OSD_PAUSE; @@ -3791,6 +3835,9 @@ if (osd_show_av_delay) { snprintf(osd_text_tmp, 63, "A-V delay: %d ms", ROUND(audio_delay*1000)); osd_show_av_delay--; + } else if (osd_show_speed) { + snprintf(osd_text_tmp, 63, "Speed: x %6.2f", playback_speed); + osd_show_speed--; } else if (osd_show_ontop) { snprintf(osd_text_tmp, 63, "Stay on top: %sabled", vo_ontop?"en":"dis"); osd_show_ontop--;