I am trying to convert mp3 file to raw file using NACL Plugin, I am using av_open_input_file()
function of libavformat/avformat.h which is under ffmpeg library. This function should return 0 but it is returning -2. Syntax for my function call is below:-
if(av_open_input_file(&pFormatCtx, infile_name.c_str(), NULL, 0, NULL)!=0)
Can any one tell me what is the problem with this call?
I am using NACL pepper_25 toolchain, I am not sure whether this toolchain will support av_open_input_file() call or not but when I am compiling my program without using NACL it works fine.
The error codes from ffmpeg seem to be the same as standard POSIX errno values, only negative. So -2 is equivalent to ENOENT. I'm guessing this means that the file does not exist.
Please note that you cannot access your local filesystem directly when using NaCl, so if you want to use read/write calls, you'll need to use the nacl_io library. Take a look at the examples/demo/nacl_io example, and the documentation here: https://developers.google.com/native-client/dev/devguide/coding/nacl_io.