Hi all,<br><br>I've been stuck with this problem for a while now. When opening a file and doing the following:<br><br>AVCodecContext *codecContext = NULL;<br>AVFormatContext *formatContext = NULL;<br>AVCodec *codec;<br>

<br>avformat_open_input(&formatContext, "a.flac", NULL, NULL);<br><div id=":1p0">int streamId = av_find_best_stream(formatContext, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0);<br>codecContext = formatContext->streams[streamId]->codec;<br>

<br>cout<<codecContext->sample_fmt<<endl;<br><br>It 
returns -1 (AV_SAMPLE_FMT_NONE).
 If I use the terminal tool (ffmpeg -i a.flac) it says s32 under the 
stream info. So what am I doing wrong that my code does not return the 
sample format? I can retrieve other info such as the sample rate.<br>
<br>Thanks<br><br>Chris</div>