mpenkov / ffmpeg-tutorial

A set of tutorials that demonstrates how to write a video player based on FFmpeg
http://www.ffmpeg.org/documentation.html
1.22k stars 395 forks source link

Ensure the decoded frame is in AV_SAMPLE_FMT_S16 or audio will be distorted #28

Closed wseemann closed 8 years ago

wseemann commented 8 years ago

I modified the example to account for changes in the new version of FFmpeg. Newer versions of FFmpeg don't always decode frames in AV_SAMPLE_FMT_S16 format. This can cause the audio playback to be distorted when using the current SDL config. I modified to the code to convert frame to AV_SAMPLE_FMT_S16 if they aren't in that format already. You don't have to merge my changes but hopefully this will be useful in case someone else encounters this issue,

mpenkov commented 8 years ago

I'm not really maintaining this project anymore (the original author does that these days), but I see no harm in merging your changes.