Image superposition on a video sequence is creating problem


I have been trying to superpose a image on a video sequence display for
some reason. It creates the following problems (the problem is following
the code modification…):

SDL_Surface *screen,*image;
SMPEG *mpeg;

then mpeg is loaded to be a mped video while image is loaded to be a bmp

I have done the following modification in the plaympeg.c file with

while ( ! done && ( pause || (SMPEG_status(mpeg) == SMPEG_PLAYING) ) )
/This part I am doing to load the white button image/
if (image->format->palette && screen->format->palette) {
SDL_SetColors(screen,image->format->palette->colors, 0,
if(SDL_BlitSurface(image,NULL,screen,NULL) < 0)
fprintf(stderr,“BlitSurface error:

        SDL_UpdateRect(screen, 0, 0, image->w, image->h);
        /*end of my modification of white bottun loading*/

        if(SDL_PollEvent(&test_event) && test_event.button.state ==

printf(“The response time is %lf
printf(“Current mouse position is: %d,%d\n”,
break; /Use exit(0) instead/

There is one more problem : if I use break, the program hangs and I have
to physically kill it using “kill” and CTRL-C does not work. However, if
I use ‘exit’ instead of ‘break’, then the program terminates properly.
However, for my purpose, I would like to use break. Any suggestion here?

How do I place the image not at the beginning of the rectangle but any
where on the display window?

Thanks and regards,