SMPEG speed problem

Hi.
I have a very strange problem playing mpeg videos with the SMPEG component.
Sometimes is played fine and sometimes terribly slow (1-2 fps) without
any aparent reason. The same machine, the same memory and even the same
cpu usage.

I will appreciate any help.
Thanks–


Agust? Puertas Carbonell (@Agusti_Puertas_Carbo)
R&D Multiplayer Machines Software Developer
UNIDESA GAMING AND SYSTEMS
CIRSA (www.cirsa.com)
Tel. 34 93 736 01 00

Is your code available anywhere?

ChrisOn 5/30/05, Agust? Puertas Carbonell wrote:

Hi.
I have a very strange problem playing mpeg videos with the SMPEG component.
Sometimes is played fine and sometimes terribly slow (1-2 fps) without
any aparent reason. The same machine, the same memory and even the same
cpu usage.


E-Mail: Chris Nystrom
Business: http://www.shaklee.net/austin
Blog: http://conversazione.blogspot.com/
AIM: nystromchris

I have this code in a separate thread. This is why i put an sleep,
allowing other threads to execute.
I got this code from an example in the Jedi Sdl library.

        SMPEG_setdisplay(SDL_mpeg, surface, nil, nil);
        SMPEG_scaleXY(SDL_mpeg, W, H);
        SMPEG_move(SDL_mpeg, X, Y);
        SMPEG_loop(SDL_mpeg, 1);
        while (SMPEG_status(SDL_mpeg) = STATUS_SMPEG_PLAYING) do begin
            Sleep(10);
        end;

En/na Chris Nystrom ha escrit:>On 5/30/05, Agust? Puertas Carbonell <@Agusti_Puertas_Carbo> wrote:

Hi.
I have a very strange problem playing mpeg videos with the SMPEG component.
Sometimes is played fine and sometimes terribly slow (1-2 fps) without
any aparent reason. The same machine, the same memory and even the same
cpu usage.

Is your code available anywhere?

Chris


Agust? Puertas Carbonell (@Agusti_Puertas_Carbo)
R&D Multiplayer Machines Software Developer
UNIDESA GAMING AND SYSTEMS
CIRSA (www.cirsa.com)
Tel. 34 93 736 01 00

Before any comment I must say that I have tried to play videos without
the Sleep and the problem is still there.

En/na Agust? Puertas Carbonell ha escrit:> I have this code in a separate thread. This is why i put an sleep,

allowing other threads to execute.
I got this code from an example in the Jedi Sdl library.

       SMPEG_setdisplay(SDL_mpeg, surface, nil, nil);
       SMPEG_scaleXY(SDL_mpeg, W, H);
       SMPEG_move(SDL_mpeg, X, Y);
       SMPEG_loop(SDL_mpeg, 1);
       while (SMPEG_status(SDL_mpeg) = STATUS_SMPEG_PLAYING) do begin
           Sleep(10);
       end;

En/na Chris Nystrom ha escrit:

On 5/30/05, Agust? Puertas Carbonell <@Agusti_Puertas_Carbo> wrote:

Hi.
I have a very strange problem playing mpeg videos with the SMPEG
component.
Sometimes is played fine and sometimes terribly slow (1-2 fps) without
any aparent reason. The same machine, the same memory and even the same
cpu usage.

Is your code available anywhere?

Chris


Agust? Puertas Carbonell (@Agusti_Puertas_Carbo)
R&D Multiplayer Machines Software Developer
UNIDESA GAMING AND SYSTEMS
CIRSA (www.cirsa.com)
Tel. 34 93 736 01 00

I found the solution! If anyone is interested, audio must have been
initialized before playing videos with smpeg, even if the video doesn’t
have any sound (that was my case).

Thanks everybody!

En/na Agust? Puertas Carbonell ha escrit:> Before any comment I must say that I have tried to play videos without

the Sleep and the problem is still there.

En/na Agust? Puertas Carbonell ha escrit:

I have this code in a separate thread. This is why i put an sleep,
allowing other threads to execute.
I got this code from an example in the Jedi Sdl library.

       SMPEG_setdisplay(SDL_mpeg, surface, nil, nil);
       SMPEG_scaleXY(SDL_mpeg, W, H);
       SMPEG_move(SDL_mpeg, X, Y);
       SMPEG_loop(SDL_mpeg, 1);
       while (SMPEG_status(SDL_mpeg) = STATUS_SMPEG_PLAYING) do 

begin
Sleep(10);
end;

En/na Chris Nystrom ha escrit:

On 5/30/05, Agust? Puertas Carbonell <@Agusti_Puertas_Carbo> wrote:

Hi.
I have a very strange problem playing mpeg videos with the SMPEG
component.
Sometimes is played fine and sometimes terribly slow (1-2 fps) without
any aparent reason. The same machine, the same memory and even the
same
cpu usage.

Is your code available anywhere?

Chris


Agust? Puertas Carbonell (@Agusti_Puertas_Carbo)
R&D Multiplayer Machines Software Developer
UNIDESA GAMING AND SYSTEMS
CIRSA (www.cirsa.com)
Tel. 34 93 736 01 00