Mercurial > libdvdnav.hg
comparison dvdnav.c @ 135:5204d4e4cd3b src
I should get a brain and learn how to handle BCD...
also fixing a possible mis-jump with angled cells
author | mroi |
---|---|
date | Wed, 26 Mar 2003 14:37:23 +0000 |
parents | d9d75a22a061 |
children | 8f63f4c25f2f |
comparison
equal
deleted
inserted
replaced
134:d9d75a22a061 | 135:5204d4e4cd3b |
---|---|
208 /* converts a dvd_time_t to PTS ticks */ | 208 /* converts a dvd_time_t to PTS ticks */ |
209 static int64_t dvdnav_convert_time(dvd_time_t *time) { | 209 static int64_t dvdnav_convert_time(dvd_time_t *time) { |
210 int64_t result; | 210 int64_t result; |
211 int frames; | 211 int frames; |
212 | 212 |
213 result = (time->hour & 0xf0) * 10 * 60 * 60 * 90000; | 213 result = (time->hour >> 4 ) * 10 * 60 * 60 * 90000; |
214 result += (time->hour & 0x0f) * 60 * 60 * 90000; | 214 result += (time->hour & 0x0f) * 60 * 60 * 90000; |
215 result += (time->minute & 0xf0) * 10 * 60 * 90000; | 215 result += (time->minute >> 4 ) * 10 * 60 * 90000; |
216 result += (time->minute & 0x0f) * 60 * 90000; | 216 result += (time->minute & 0x0f) * 60 * 90000; |
217 result += (time->second & 0xf0) * 10 * 90000; | 217 result += (time->second >> 4 ) * 10 * 90000; |
218 result += (time->second & 0x0f) * 90000; | 218 result += (time->second & 0x0f) * 90000; |
219 frames = (time->frame_u & 0x30) * 10 ; | 219 |
220 frames += (time->frame_u & 0x0f) ; | 220 frames = ((time->frame_u & 0x30) >> 4) * 10; |
221 frames += ((time->frame_u & 0x0f) ) ; | |
222 | |
221 if (time->frame_u & 0x80) | 223 if (time->frame_u & 0x80) |
222 result += frames * 3000; | 224 result += frames * 3000; |
223 else | 225 else |
224 result += frames * 3600; | 226 result += frames * 3600; |
225 | 227 |
1014 return this->position_next.still; | 1016 return this->position_next.still; |
1015 } | 1017 } |
1016 | 1018 |
1017 /* | 1019 /* |
1018 * $Log$ | 1020 * $Log$ |
1021 * Revision 1.47 2003/03/26 14:37:22 mroi | |
1022 * I should get a brain and learn how to handle BCD... | |
1023 * also fixing a possible mis-jump with angled cells | |
1024 * | |
1019 * Revision 1.46 2003/03/25 12:46:26 mroi | 1025 * Revision 1.46 2003/03/25 12:46:26 mroi |
1020 * - new event on cell changes to report program and cell number and some time info | 1026 * - new event on cell changes to report program and cell number and some time info |
1021 * - get rid of memcopies in event handling | 1027 * - get rid of memcopies in event handling |
1022 * | 1028 * |
1023 * Revision 1.45 2003/03/15 20:18:50 mroi | 1029 * Revision 1.45 2003/03/15 20:18:50 mroi |