Initialize the audio_format before calling avcodec_open(), because avcodec_open() will fill bogus values.
Attach a file by drag & drop or click to upload