diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-11-08 20:30:03 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-11-08 20:41:28 -0800 |
commit | 44d25eeed23e6bb4b6c95acca38b039d5af99d00 (patch) | |
tree | 9307fb055329f5aa7d27784f3f8b162f322d2001 /src/rmd_cache.c | |
parent | f2f4c34760de661f1dfe33c06760053692fece90 (diff) |
cache: pivot to new CacheFile API
This minimally switches all the ad-hoc image cache files handling
over to using CacheFile.
I left the audio cache alone for now as it seems to not be
compressed. It might make sense in the future to switch that
over as well, especially if I start adding features to CacheFile
like preallocating and async periodic fdatasync.
Diffstat (limited to 'src/rmd_cache.c')
-rw-r--r-- | src/rmd_cache.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/rmd_cache.c b/src/rmd_cache.c index 94c0b68..db7682e 100644 --- a/src/rmd_cache.c +++ b/src/rmd_cache.c @@ -357,18 +357,10 @@ void rmdInitCacheData(ProgData *pdata, EncData *enc_data_t, CacheData *cache_dat exit(13); } - if (!pdata->args.zerocompression) { - cache_data_t->ifp = gzopen(cache_data_t->imgdata, "wb0f"); - if (cache_data_t->ifp == NULL) { - fprintf(stderr, "Could not create temporary file %s !!!\n", cache_data_t->imgdata); - exit(13); - } - } else { - cache_data_t->uncifp = fopen(cache_data_t->imgdata, "wb0f"); - if (cache_data_t->uncifp == NULL) { - fprintf(stderr, "Could not create temporary file %s !!!\n", cache_data_t->imgdata); - exit(13); - } + cache_data_t->icf = rmdCacheFileOpen(pdata, cache_data_t->imgdata, RMD_CACHE_FILE_MODE_WRITE); + if (cache_data_t->icf == NULL) { + fprintf(stderr, "Could not create temporary file %s !!!\n", cache_data_t->imgdata); + exit(13); } if (!pdata->args.nosound) { |