comparison dvd_input.c @ 18:2a219d444297 src

Comments cleanup: fix spelling and grammar errors. Patch by: Erik Hovland !erik#hovland at org*
author rathann
date Mon, 01 Sep 2008 21:04:33 +0000
parents fdbae45c30fc
children 7f7e87bd7536
comparison
equal deleted inserted replaced
17:5aeaa695eadb 18:2a219d444297
115 /* DVDINPUT_NOFLAGS should match the DVDCSS_NOFLAGS value. */ 115 /* DVDINPUT_NOFLAGS should match the DVDCSS_NOFLAGS value. */
116 return DVDcss_seek(dev->dvdcss, blocks, DVDINPUT_NOFLAGS); 116 return DVDcss_seek(dev->dvdcss, blocks, DVDINPUT_NOFLAGS);
117 } 117 }
118 118
119 /** 119 /**
120 * set the block for the begining of a new title (key). 120 * set the block for the beginning of a new title (key).
121 */ 121 */
122 static int css_title(dvd_input_t dev, int block) 122 static int css_title(dvd_input_t dev, int block)
123 { 123 {
124 return DVDcss_title(dev->dvdcss, block); 124 return DVDcss_title(dev->dvdcss, block);
125 } 125 }
206 /* assert pos % DVD_VIDEO_LB_LEN == 0 */ 206 /* assert pos % DVD_VIDEO_LB_LEN == 0 */
207 return (int) (pos / DVD_VIDEO_LB_LEN); 207 return (int) (pos / DVD_VIDEO_LB_LEN);
208 } 208 }
209 209
210 /** 210 /**
211 * set the block for the begining of a new title (key). 211 * set the block for the beginning of a new title (key).
212 */ 212 */
213 static int file_title(dvd_input_t dev, int block) 213 static int file_title(dvd_input_t dev, int block)
214 { 214 {
215 return -1; 215 return -1;
216 } 216 }
229 229
230 ret = read(dev->fd, buffer, len); 230 ret = read(dev->fd, buffer, len);
231 231
232 if(ret < 0) { 232 if(ret < 0) {
233 /* One of the reads failed, too bad. We won't even bother 233 /* One of the reads failed, too bad. We won't even bother
234 * returning the reads that went ok, and as in the posix spec 234 * returning the reads that went OK, and as in the POSIX spec
235 * the file postition is left unspecified after a failure. */ 235 * the file position is left unspecified after a failure. */
236 return ret; 236 return ret;
237 } 237 }
238 238
239 if(ret == 0) { 239 if(ret == 0) {
240 /* Nothing more to read. Return the whole blocks, if any, that we got. 240 /* Nothing more to read. Return all of the whole blocks, if any.
241 and adjust the file possition back to the previous block boundary. */ 241 * Adjust the file position back to the previous block boundary. */
242 size_t bytes = (size_t)blocks * DVD_VIDEO_LB_LEN - len; 242 size_t bytes = (size_t)blocks * DVD_VIDEO_LB_LEN - len;
243 off_t over_read = -(bytes % DVD_VIDEO_LB_LEN); 243 off_t over_read = -(bytes % DVD_VIDEO_LB_LEN);
244 /*off_t pos =*/ lseek(dev->fd, over_read, SEEK_CUR); 244 /*off_t pos =*/ lseek(dev->fd, over_read, SEEK_CUR);
245 /* should have pos % 2048 == 0 */ 245 /* should have pos % 2048 == 0 */
246 return (int) (bytes / DVD_VIDEO_LB_LEN); 246 return (int) (bytes / DVD_VIDEO_LB_LEN);