From 6148b787452be2f57961089114e86bdf7d6aff1f Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 26 May 2017 17:18:58 +0300 Subject: [PATCH] Read after AVERROR_INVALIDDATA in video sound. Partially reverse c1c3e4af5b that stopped on error in such cases. --- Telegram/SourceFiles/media/media_child_ffmpeg_loader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/media/media_child_ffmpeg_loader.cpp b/Telegram/SourceFiles/media/media_child_ffmpeg_loader.cpp index 649a97c920..bb7e57e66b 100644 --- a/Telegram/SourceFiles/media/media_child_ffmpeg_loader.cpp +++ b/Telegram/SourceFiles/media/media_child_ffmpeg_loader.cpp @@ -157,9 +157,9 @@ AudioPlayerLoader::ReadResult ChildFFMpegLoader::readMore(QByteArray &result, in LOG(("Audio Error: Unable to avcodec_send_packet() file '%1', data size '%2', error %3, %4").arg(_file.name()).arg(_data.size()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); // There is a sample voice message where skipping such packet // results in a crash (read_access to nullptr) in swr_convert(). - //if (res == AVERROR_INVALIDDATA) { - // return ReadResult::NotYet; // try to skip bad packet - //} + if (res == AVERROR_INVALIDDATA) { + return ReadResult::NotYet; // try to skip bad packet + } return ReadResult::Error; } FFMpeg::freePacket(&packet);