FFMS / ffms2

An FFmpeg based source library and Avisynth/VapourSynth plugin for easy frame accurate access
Other
574 stars 104 forks source link

fixbug: audio maybe deap loop when DecodeNextBlock failed. #362

Closed taniey closed 2 years ago

myrsloik commented 3 years ago

Do you have a sample file where this happens?

taniey commented 3 years ago

Do you have a sample file where this happens?

Sorry, I have lost the audio file about this! But, I'm sure that it will dead loop .when DecodeNextBlock failed. when I debug the audio decode(avcodec_receive_frame), I find the ffmpeg decode return 2048 bytes , and next decode (avcodec_receive_frame) return ( 0 bytes frame, the return value is AVERROR(EAGAIN)) (this condition very rarely , only once!) , so when decode return 0 ,the DecodeNextBlock local valiable(NumberOfSamples) will return 0, and GetAudio function will can't return as the PacketNumber can't PacketNumber++.

myrsloik commented 2 years ago

No sample and a patch that mangles space so I can't be bothered to read it. Most likely caused by a mildly corrupt file as well.