Skip to content

Commit

Permalink
wavpack: Don't try to open .wvc file if it doesn't exist. Also fix a …
Browse files Browse the repository at this point in the history
…typo causing wv_attach() to return TRUE always.
  • Loading branch information
jlindgren90 committed Jan 3, 2013
1 parent f4d290f commit bd3b373
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/wavpack/wavpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,14 @@ static bool_t wv_attach (const char * filename, VFSFile * wv_input,
if (flags & OPEN_WVC)
{
SPRINTF (corrFilename, "%sc", filename);
*wvc_input = vfs_fopen(corrFilename, "rb");
if (vfs_file_test (corrFilename, VFS_IS_REGULAR))
* wvc_input = vfs_fopen (corrFilename, "r");
else
* wvc_input = NULL;
}

* ctx = WavpackOpenFileInputEx (& wv_readers, wv_input, * wvc_input, error,
flags, 0);

if (ctx == NULL)
return FALSE;
else
return TRUE;
* ctx = WavpackOpenFileInputEx (& wv_readers, wv_input, * wvc_input, error, flags, 0);
return (* ctx != NULL);
}

static void wv_deattach (VFSFile * wvc_input, WavpackContext * ctx)
Expand Down

0 comments on commit bd3b373

Please sign in to comment.