XReparentWindow() on SDL surface's window

As part of an academic project we have an SDL window playing mpeg (using
smpeg library)
and another top-level larger window on the root window. I am trying to make
the free-standing
SDL window (normally appearing at the top left corner) to be child of this
other large window
and make it play at a position inside the new parent.
I tried XReparentWindow() and the window moved to the desired position. But
there is
a black background or window of the same size seen at its original position
too.
Taskbar button for this SDL window is also present in the root window task
bar.

Why does this happen and how to eliminate this black window and the taskbar
button
so that it totally becomes a child of the other window.

Following is relevant portion of the code. Platform used is Linux.

extern Window g_wnd; // top-level window

void* plaympeg()
{
SDL_Surface *screen;
SMPEG *mpeg;
Window sdlwin;

g_display = XOpenDisplay(NULL);
// Initialize SDL

// Create the MPEG stream
if((fd = tcp_open(client_addr, client_port)) != 0)
mpeg = SMPEG_new_descr(fd, &info, use_audio);
SMPEG_enableaudio(mpeg, use_audio);
SMPEG_enablevideo(mpeg, use_video);
SMPEG_setvolume(mpeg, volume);

screen = SDL_SetVideoMode(info.width, info.height, video_bpp,
video_flags);

sdlwin = GetSDLWindow(); //SDL_SysWMinfo.info.x11.window
// Embed the video window inside TS window
XReparentWindow(g_display, sdlwin, g_wnd, x, y);
SMPEG_setdisplay(mpeg, screen, NULL, update);
SMPEG_scaleXY(mpeg, screen->w, screen->h);
SMPEG_play(mpeg);

// event loop


}