ffmpegencoder: improvements to resampling

Updates the AVFrame's nb_samples field to the amount of samples retrieved from
swresample so it doesn't encode more or less samples than it has.
This commit is contained in:
itsmattkc
2020-04-05 00:12:23 +11:00
parent 626c50477c
commit fb1cf1edaf
2 changed files with 46 additions and 18 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ private:
*/
void FFmpegError(const char *context, int error_code);
void WriteAVFrame(AVFrame* frame, AVCodecContext *codec_ctx, AVStream *stream);
bool WriteAVFrame(AVFrame* frame, AVCodecContext *codec_ctx, AVStream *stream);
bool InitializeStream(enum AVMediaType type, AVStream** stream, AVCodecContext** codec_ctx, const QString& codec);
bool InitializeCodecContext(AVStream** stream, AVCodecContext** codec_ctx, AVCodec* codec);