# HG changeset patch # User vayne # Date 1173537208 0 # Node ID 1c5ea79749ea87206a37d7c1d796d731b02cce0a # Parent afe33a1c6e75c6aa8865bfa7b2864fc71fd0c645 fixed dvd chapter and title switching diff -r afe33a1c6e75 -r 1c5ea79749ea Gui/win32/dialogs.c --- a/Gui/win32/dialogs.c Sat Mar 10 14:32:19 2007 +0000 +++ b/Gui/win32/dialogs.c Sat Mar 10 14:33:28 2007 +0000 @@ -143,6 +143,7 @@ { if (GetFullPathName(filename, MAX_PATH, filename, &filepart)) { + mplSetFileName(NULL, filename, STREAMTYPE_FILE); if(!parse_filename(filename, playtree, mconfig, 0)) gui->playlist->add_track(gui->playlist, filename, NULL, filepart, 0); mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] Adding file: %s - path %s\n", filespec, filename); @@ -791,6 +792,7 @@ int i=0, j=0; char titles[MAX_PATH] = ""; char chapters[MAX_PATH] = ""; + gui_t *gui = (gui_t *) GetWindowLongPtr(hwnd, GWLP_USERDATA); switch (iMsg) { case WM_CREATE: @@ -859,9 +861,7 @@ if((guiIntfStruct.DVD.current_title != 0 || guiIntfStruct.DVD.current_chapter != 0)) { - mplGotoTheNext = 0; - guiGetEvent(guiCEvent, (void *) guiSetStop); - guiGetEvent(guiCEvent, (void *) guiSetPlay); + gui->startplay(gui); DestroyWindow(hwnd); } } diff -r afe33a1c6e75 -r 1c5ea79749ea Gui/win32/gui.c --- a/Gui/win32/gui.c Sat Mar 10 14:32:19 2007 +0000 +++ b/Gui/win32/gui.c Sat Mar 10 14:33:28 2007 +0000 @@ -451,6 +451,7 @@ for(i=0; iplaylist->add_track(gui->playlist, file, NULL, NULL, 0); } @@ -722,6 +723,7 @@ { PCOPYDATASTRUCT cdData; cdData = (PCOPYDATASTRUCT) lParam; + mplSetFileName(NULL, cdData->lpData, STREAMTYPE_FILE); if(!parse_filename(cdData->lpData, playtree, mconfig, 1)) gui->playlist->add_track(gui->playlist, cdData->lpData, NULL, NULL, 0); gui->startplay(gui); @@ -738,6 +740,7 @@ for(i=0; iplaylist->add_track(gui->playlist, file, NULL, NULL, 0); } diff -r afe33a1c6e75 -r 1c5ea79749ea Gui/win32/interface.c --- a/Gui/win32/interface.c Sat Mar 10 14:32:19 2007 +0000 +++ b/Gui/win32/interface.c Sat Mar 10 14:33:28 2007 +0000 @@ -167,10 +167,6 @@ guiIntfStruct.DiskChanged = 1; mplSetFileName(NULL, dvd_device, STREAMTYPE_DVD); - guiIntfStruct.Title = guiIntfStruct.DVD.current_title; - guiIntfStruct.Chapter = guiIntfStruct.DVD.current_chapter; - guiIntfStruct.Angle = guiIntfStruct.DVD.current_angle; - dvdname[0] = 0; strcat(dvdname, "DVD Movie"); GetVolumeInformation(dvd_device, dvdname, MAX_PATH, NULL, NULL, NULL, NULL, 0); @@ -281,13 +277,28 @@ case evDropFile: case evLoadPlay: { - mplSetFileName(NULL, filename, STREAMTYPE_FILE); - guiIntfStruct.FilenameChanged = guiIntfStruct.NewPlay = 1; - update_playlistwindow(); - mplGotoTheNext = guiIntfStruct.Playing? 0 : 1; - guiGetEvent(guiCEvent, (void *) guiSetStop); - guiGetEvent(guiCEvent, (void *) guiSetPlay); - break; + switch(guiIntfStruct.StreamType) + { + case STREAMTYPE_DVD: + { + guiIntfStruct.Title = guiIntfStruct.DVD.current_title; + guiIntfStruct.Chapter = guiIntfStruct.DVD.current_chapter; + guiIntfStruct.Angle = guiIntfStruct.DVD.current_angle; + guiIntfStruct.DiskChanged = 1; + guiGetEvent(guiCEvent, (void *) guiSetPlay); + break; + } + default: + { + guiIntfStruct.FilenameChanged = guiIntfStruct.NewPlay = 1; + update_playlistwindow(); + mplGotoTheNext = guiIntfStruct.Playing? 0 : 1; + guiGetEvent(guiCEvent, (void *) guiSetStop); + guiGetEvent(guiCEvent, (void *) guiSetPlay); + break; + } + } + break; } case evNext: mplNext();