mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-04-17 12:52:48 +00:00
Fix checking cover stream on seeking
This commit is contained in:
parent
690c5df87c
commit
a986d7a3d6
@ -148,6 +148,10 @@ Stream File::Context::initStream(
|
||||
|
||||
const auto info = format->streams[index];
|
||||
if (type == AVMEDIA_TYPE_VIDEO) {
|
||||
if (info->disposition & AV_DISPOSITION_ATTACHED_PIC) {
|
||||
// ignore cover streams
|
||||
return Stream();
|
||||
}
|
||||
result.rotation = FFmpeg::ReadRotationFromMetadata(info);
|
||||
result.aspect = FFmpeg::ValidateAspectRatio(info->sample_aspect_ratio);
|
||||
} else if (type == AVMEDIA_TYPE_AUDIO) {
|
||||
@ -159,10 +163,6 @@ Stream File::Context::initStream(
|
||||
|
||||
result.codec = FFmpeg::MakeCodecPointer(info);
|
||||
if (!result.codec) {
|
||||
if (info->codecpar->codec_id == AV_CODEC_ID_MJPEG) {
|
||||
// mp3 files contain such "video stream", just ignore it.
|
||||
return Stream();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user