View Single Post
Old 30 April 2006, 10:56 pm   #3
Zenitram
Member
 
Join Date: Apr 2006
Posts: 5
Default

Quote:
Originally Posted by Lefungus
Which code are you talking about ? There's no std::string in libmpcdec.
After a quick look at the sources, libmpcdec does check invalid profile id and use "n.a." as profile_name
std::string is my code, sorry I have not be enough explicit
Code:
    FILE *File=_wfopen(CompleteFileName.c_str(), L"rb");
    if (!File)
        return -1;
    mpc_reader_file Reader;
    mpc_reader_setup_file_reader(&Reader, File);

    mpc_streaminfo Info;
    mpc_streaminfo_init(&Info);
    if (mpc_streaminfo_read(&Info, &Reader.reader)!=ERROR_CODE_OK)
    {
        fclose(File);
        return -1; //Not a Musepack file
    }
    if (Info.profile_name)
       std::string S=Info.profile_name;
And with the the given file, it crashes, maybe not for the reason I suspected.
would you like I give you an example complete source code?
__________________
Want to know all about your media files? http://mediainfo.sourceforge.net
Zenitram is offline   Reply With Quote