Mercurial > libdvdnav.hg
comparison read_cache.c @ 76:0e2abe7083de src
more consistent console output
author | mroi |
---|---|
date | Tue, 27 Aug 2002 19:15:08 +0000 |
parents | bf89c194f781 |
children | 8905d8de7e91 |
comparison
equal
deleted
inserted
replaced
75:06cda03dc1e5 | 76:0e2abe7083de |
---|---|
91 /* Bit of strange cross-linking going on here :) -- Gotta love C :) */ | 91 /* Bit of strange cross-linking going on here :) -- Gotta love C :) */ |
92 dvdnav_t *dvd_self; | 92 dvdnav_t *dvd_self; |
93 }; | 93 }; |
94 #endif | 94 #endif |
95 | 95 |
96 #define _MT_TRACE 0 | 96 #define READ_CACHE_TRACE 0 |
97 | 97 |
98 #if _MT_TRACE | 98 #if READ_CACHE_TRACE |
99 #define dprintf(fmt, args...) fprintf(stderr, "%s: "fmt, __func__ , ## args); | 99 #define dprintf(fmt, args...) fprintf(MSG_OUT, "libdvdnav: %s: "fmt, __func__ , ## args); |
100 #else | 100 #else |
101 #define dprintf(fmt, args...) /* Nowt */ | 101 #define dprintf(fmt, args...) /* Nowt */ |
102 #endif | 102 #endif |
103 | 103 |
104 #if _MULTITHREAD_ | 104 #if _MULTITHREAD_ |
310 return (int)block_count; | 310 return (int)block_count; |
311 } | 311 } |
312 } else { | 312 } else { |
313 /* Miss */ | 313 /* Miss */ |
314 | 314 |
315 fprintf(stderr, "DVD read cache miss! (not bad but a performance hit) sector=%d\n", sector); | 315 fprintf(MSG_OUT, "libdvdnav: DVD read cache miss! (not bad but a performance hit) sector=%d\n", sector); |
316 result = DVDReadBlocks( self->dvd_self->file, sector, block_count, *buf); | 316 result = DVDReadBlocks( self->dvd_self->file, sector, block_count, *buf); |
317 self->read_point = sector+block_count; | 317 self->read_point = sector+block_count; |
318 if(self->read_point > self->pos + self->size) { | 318 if(self->read_point > self->pos + self->size) { |
319 /* Flush the cache as its not much use */ | 319 /* Flush the cache as its not much use */ |
320 dprintf("Contents irrelevent... flushing\n"); | 320 dprintf("Contents irrelevent... flushing\n"); |