mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Fix checking cover stream on seeking
This commit is contained in:
parent
690c5df87c
commit
a986d7a3d6
1 changed files with 4 additions and 4 deletions
|
@ -148,6 +148,10 @@ Stream File::Context::initStream(
|
||||||
|
|
||||||
const auto info = format->streams[index];
|
const auto info = format->streams[index];
|
||||||
if (type == AVMEDIA_TYPE_VIDEO) {
|
if (type == AVMEDIA_TYPE_VIDEO) {
|
||||||
|
if (info->disposition & AV_DISPOSITION_ATTACHED_PIC) {
|
||||||
|
// ignore cover streams
|
||||||
|
return Stream();
|
||||||
|
}
|
||||||
result.rotation = FFmpeg::ReadRotationFromMetadata(info);
|
result.rotation = FFmpeg::ReadRotationFromMetadata(info);
|
||||||
result.aspect = FFmpeg::ValidateAspectRatio(info->sample_aspect_ratio);
|
result.aspect = FFmpeg::ValidateAspectRatio(info->sample_aspect_ratio);
|
||||||
} else if (type == AVMEDIA_TYPE_AUDIO) {
|
} else if (type == AVMEDIA_TYPE_AUDIO) {
|
||||||
|
@ -159,10 +163,6 @@ Stream File::Context::initStream(
|
||||||
|
|
||||||
result.codec = FFmpeg::MakeCodecPointer(info);
|
result.codec = FFmpeg::MakeCodecPointer(info);
|
||||||
if (!result.codec) {
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue