Ticket #8098: cd-loop.diff

File cd-loop.diff, 2.9 KB (added by eriktorbjorn, 18 years ago)

Patch against an October 19 CVS snapshot

  • scummvm/backends/sdl/sdl-common.cpp

    diff -ur ScummVM-cvs20021019/scummvm/backends/sdl/sdl-common.cpp ScummVM-cvs20021019+hack/scummvm/backends/sdl/sdl-common.cpp
    old new  
    825825        cd_num_loops = num_loops;
    826826        cd_start_frame = start_frame;
    827827
    828         SDL_CDStatus(_cdrom);   
    829         SDL_CDPlayTracks(_cdrom, track, start_frame, 0, end_frame);
     828        SDL_CDStatus(_cdrom);
     829        if (start_frame == 0 && end_frame == 0)
     830                SDL_CDPlayTracks(_cdrom, track, 0, 1, 0);
     831        else
     832                SDL_CDPlayTracks(_cdrom, track, start_frame, 0, end_frame);
    830833        cd_end_frame = end_frame;
    831834        cd_stop_time = 0;
    832835        cd_end_time = SDL_GetTicks() + _cdrom->track[track].length * 1000 / CD_FPS;
     
    863866                cd_num_loops--;
    864867
    865868        if (cd_num_loops != 0) {
    866                 SDL_CDPlayTracks(_cdrom, cd_track, cd_start_frame, 0, cd_end_frame);
     869                if (cd_start_frame == 0 && cd_end_frame == 0)
     870                        SDL_CDPlayTracks(_cdrom, cd_track, 0, 1, 0);
     871                else
     872                        SDL_CDPlayTracks(_cdrom, cd_track, cd_start_frame, 0, cd_end_frame);
    867873                cd_end_time = SDL_GetTicks() + _cdrom->track[cd_track].length * 1000 / CD_FPS;
    868874        }
    869875}
  • scummvm/scumm/sound.cpp

    diff -ur ScummVM-cvs20021019/scummvm/scumm/sound.cpp ScummVM-cvs20021019+hack/scummvm/scumm/sound.cpp
    old new  
    13491349                _scumm->_mixer->stop(_mp3_index);               
    13501350        _mp3_index = _scumm->_mixer->playMP3CDTrack(NULL, _mp3_tracks[index], duration);
    13511351        _mp3_cd_playing = true;
     1352        _mp3_cd_track = track;
     1353        _mp3_cd_num_loops = num_loops;
     1354        _mp3_cd_start = start;
     1355        _mp3_cd_delay = delay;
    13521356        return 0;
    13531357}
    13541358
     
    13561360        if (_mp3_cd_playing == true) {
    13571361                _scumm->_mixer->stop(_mp3_index);
    13581362                _mp3_cd_playing = false;
     1363                _mp3_cd_track = 0;
     1364                _mp3_cd_num_loops = 0;
     1365                _mp3_cd_start = 0;
     1366                _mp3_cd_delay = 0;
    13591367                return 0;
    13601368        }
    13611369        return -1;
     
    13761384                return -1;
    13771385        }
    13781386
    1379         if (_scumm->_mixer->_channels[_mp3_index]->soundFinished())
    1380                 stopMP3CD();
     1387        if (_scumm->_mixer->_channels[_mp3_index]->soundFinished()) {
     1388                if (_mp3_cd_num_loops == -1 || --_mp3_cd_num_loops > 0)
     1389                        playMP3CDTrack(_mp3_cd_track, _mp3_cd_num_loops, _mp3_cd_start, _mp3_cd_delay);
     1390                else
     1391                        stopMP3CD();
     1392        }
     1393
    13811394        return 0;
    13821395}
    13831396#endif
  • scummvm/scumm/sound.h

    Only in ScummVM-cvs20021019+hack/scummvm/scumm: sound.cpp.~1.36.~
    diff -ur ScummVM-cvs20021019/scummvm/scumm/sound.h ScummVM-cvs20021019+hack/scummvm/scumm/sound.h
    old new  
    7878        long _mp3_size[CACHE_TRACKS];
    7979        File *_mp3_tracks[CACHE_TRACKS];
    8080        int _mp3_index;
     81        int _mp3_cd_track;
     82        int _mp3_cd_start;
     83        int _mp3_cd_delay;
     84        int _mp3_cd_num_loops;
    8185        bool _mp3_cd_playing;
    8286#endif
    8387