[MPlayer-users] I found the loop bug .. and patch..
Arpi
arpi at thot.banki.hu
Sat Nov 24 14:32:44 CET 2001
Hi,
plase do it for the CVS version, and send diff -u to -dev-eng list.
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html &
> http://gcc.gnu.org/gcc-2.96.html if you still have questions or problems]
>
>
>
> ( I am poor in English. so if you find a fault sentence, forgive me !!)
>
> Thank ! developers.
>
> I am lover for Mplayer
>
> I have used well the Mplayer!!
>
> but I found the loop bug :)
>
> I made the loop option for me. ( "-loop" )
>
> the patch codes are a little dirty. but It works well.
>
> I modified only 3 files "mplayer.c mplayer.h cfg-mplayer.h"
> and I add only 18 lines
>
> the modified version is "0.50"
>
> I attached the patch ..
>
> bye ! have a nice day
>
>
> diff -uNr MPlayer-0.50-orig/cfg-mplayer.h MPlayer-0.50/cfg-mplayer.h
> --- MPlayer-0.50-orig/cfg-mplayer.h Wed Oct 3 23:41:39 2001
> +++ MPlayer-0.50/cfg-mplayer.h Sat Nov 24 19:22:04 2001
> @@ -257,5 +257,6 @@
> {"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
> {"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
> {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
> + {"loop", &is_loop, CONF_TYPE_FLAG, 0, 0, 1},
> {NULL, NULL, 0, 0, 0, 0}
> };
> diff -uNr MPlayer-0.50-orig/mplayer.c MPlayer-0.50/mplayer.c
> --- MPlayer-0.50-orig/mplayer.c Sun Oct 7 09:57:28 2001
> +++ MPlayer-0.50/mplayer.c Sat Nov 24 20:15:05 2001
> @@ -210,6 +210,8 @@
> int audio_family=-1; // override audio codec family
> int video_family=-1; // override video codec family
>
> +int is_loop=0;
> +float total_play_time=0;
> // IMHO this stuff is no longer of use, or is there a special
> // reason why dshow should be completely disabled? - atmos ::
> // yes, people without working c++ compiler can disable it - A'rpi
> @@ -1188,10 +1190,22 @@
>
> total_time_usage_start=GetTimer();
>
> -while(!eof){
> +while(1){
> unsigned int aq_total_time=GetTimer();
> float aq_sleep_time=0;
>
> + if(eof) {
> + if( !is_loop ) break;
> + else{
> + rel_seek_secs= -total_play_time;
> + eof=0;
> + d_audio->eof=0;
> + d_video->eof=0;
> + goto seek_module;
> + }
> +
> + }
> +
> if(play_n_frames>=0){
> --play_n_frames;
> if(play_n_frames<0) exit_player(MSGTR_Exit_frames);
> @@ -1350,6 +1364,7 @@
> current_module="av_sync";
>
> // Increase video timers:
> + total_play_time+=frame_time;
> sh_video->num_frames+=frame_time;
> ++sh_video->num_frames_decoded;
> frame_time*=sh_video->frametime;
> @@ -1832,7 +1847,10 @@
>
> seek_to_sec = NULL;
> }
> -
> +
> +
> +seek_module:
> +
> if(rel_seek_secs || abs_seek_pos){
> current_module="seek";
> if(demux_seek(demuxer,rel_seek_secs,abs_seek_pos)){
> diff -uNr MPlayer-0.50-orig/mplayer.h MPlayer-0.50/mplayer.h
> --- MPlayer-0.50-orig/mplayer.h Tue Jun 5 03:41:34 2001
> +++ MPlayer-0.50/mplayer.h Sat Nov 24 18:12:18 2001
> @@ -82,4 +82,6 @@
> extern void parse_cfgfiles( void );
> extern void exit_player(char* how);
>
> +extern int is_loop=1;
> +
> #endif
>
>
A'rpi / Astral & ESP-team
--
mailto:arpi at thot.banki.hu
http://esp-team.scene.hu
More information about the MPlayer-users
mailing list