diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-08-29 10:57:49 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-08-29 10:57:49 +0000 |
| commit | ba48ba37037f0fde667c3f92f863b09c3446acce (patch) | |
| tree | dac91b2424d83f89c33091dc730bfa2b3c955fc5 /plugins | |
| parent | c069f20b54965ea0ad89c1010e549480bd018b76 (diff) | |
| download | pcsxr-ba48ba37037f0fde667c3f92f863b09c3446acce.tar.gz | |
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@28100 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/dfcdrom/cdr.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/dfcdrom/cdr.c b/plugins/dfcdrom/cdr.c index 2b2316fc..58e56275 100644 --- a/plugins/dfcdrom/cdr.c +++ b/plugins/dfcdrom/cdr.c @@ -35,6 +35,8 @@ static inline int msf_to_lba(char m, char s, char f) { return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET; } +int initial_time = 0; + pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t cond = PTHREAD_COND_INITIALIZER; @@ -127,6 +129,7 @@ long CDRopen(void) { playing = 0; stopth = 0; + initial_time = 0; return 0; } @@ -365,6 +368,18 @@ long CDRplay(unsigned char *sector) { if (cdHandle < 1) return 0; + // If play was called with the same time as the previous call, + // don't restart it. of course, if play is called with a different + // track, stop playing the current stream. + if (playing) + { + if (msf_to_lba(sector[0], sector[1], sector[2]) == initial_time) + return 0; + else + CDRstop(); + } + initial_time = msf_to_lba(sector[0], sector[1], sector[2]); + // 0 is the last track of every cdrom, so play up to there if (CDRgetTD(0, ptmp) == -1) return -1; @@ -402,6 +417,7 @@ long CDRstop(void) { } playing = 0; + initial_time = 0; return 0; } |
