diff --git a/src/lib/ffmpeg-4.0/avformat.pas b/src/lib/ffmpeg-4.0/avformat.pas index 2537daca6..f16446d34 100644 --- a/src/lib/ffmpeg-4.0/avformat.pas +++ b/src/lib/ffmpeg-4.0/avformat.pas @@ -53,6 +53,7 @@ interface AVFMT_FLAG_GENPTS = 1; AVSEEK_FLAG_ANY = 4; AVSEEK_FLAG_BACKWARD = 1; + AV_DISPOSITION_ATTACHED_PIC = 1024; type PAVInputFormat = ^TAVInputFormat; PAVStream = ^TAVStream; @@ -87,7 +88,7 @@ TAVStream = record start_time: cint64; we_do_not_use_duration: cint64; we_do_not_use_nb_frames: cint64; - we_do_not_use_disposition: cint; + disposition: cint; we_do_not_use_discard: cenum; we_do_not_use_sample_aspect_ratio: TAVRational; we_do_not_use_metadata: PAVDictionary; diff --git a/src/lib/ffmpeg-5.0/avformat.pas b/src/lib/ffmpeg-5.0/avformat.pas index 80a7a4eb7..971193dac 100644 --- a/src/lib/ffmpeg-5.0/avformat.pas +++ b/src/lib/ffmpeg-5.0/avformat.pas @@ -53,6 +53,7 @@ interface AVFMT_FLAG_GENPTS = 1; AVSEEK_FLAG_ANY = 4; AVSEEK_FLAG_BACKWARD = 1; + AV_DISPOSITION_ATTACHED_PIC = 1024; type PAVInputFormat = ^TAVInputFormat; PAVStream = ^TAVStream; @@ -85,7 +86,7 @@ TAVStream = record start_time: cint64; we_do_not_use_duration: cint64; we_do_not_use_nb_frames: cint64; - we_do_not_use_disposition: cint; + disposition: cint; we_do_not_use_discard: cenum; we_do_not_use_sample_aspect_ratio: TAVRational; we_do_not_use_metadata: PAVDictionary; diff --git a/src/lib/ffmpeg-6.0/avformat.pas b/src/lib/ffmpeg-6.0/avformat.pas index a56a1ab02..bcca98068 100644 --- a/src/lib/ffmpeg-6.0/avformat.pas +++ b/src/lib/ffmpeg-6.0/avformat.pas @@ -53,6 +53,7 @@ interface AVFMT_FLAG_GENPTS = 1; AVSEEK_FLAG_ANY = 4; AVSEEK_FLAG_BACKWARD = 1; + AV_DISPOSITION_ATTACHED_PIC = 1024; type PAVInputFormat = ^TAVInputFormat; PAVStream = ^TAVStream; @@ -87,7 +88,7 @@ TAVStream = record start_time: cint64; we_do_not_use_duration: cint64; we_do_not_use_nb_frames: cint64; - we_do_not_use_disposition: cint; + disposition: cint; we_do_not_use_discard: cenum; we_do_not_use_sample_aspect_ratio: TAVRational; we_do_not_use_metadata: PAVDictionary; diff --git a/src/lib/ffmpeg-7.0/avformat.pas b/src/lib/ffmpeg-7.0/avformat.pas index c020fc1b2..00adea508 100644 --- a/src/lib/ffmpeg-7.0/avformat.pas +++ b/src/lib/ffmpeg-7.0/avformat.pas @@ -53,6 +53,7 @@ interface AVFMT_FLAG_GENPTS = 1; AVSEEK_FLAG_ANY = 4; AVSEEK_FLAG_BACKWARD = 1; + AV_DISPOSITION_ATTACHED_PIC = 1024; type PAVInputFormat = ^TAVInputFormat; PAVStream = ^TAVStream; @@ -91,7 +92,7 @@ TAVStream = record start_time: cint64; we_do_not_use_duration: cint64; we_do_not_use_nb_frames: cint64; - we_do_not_use_disposition: cint; + disposition: cint; we_do_not_use_discard: cenum; we_do_not_use_sample_aspect_ratio: TAVRational; we_do_not_use_metadata: PAVDictionary; diff --git a/src/media/UMediaCore_FFmpeg.pas b/src/media/UMediaCore_FFmpeg.pas index 69cf99d37..0a478fb85 100644 --- a/src/media/UMediaCore_FFmpeg.pas +++ b/src/media/UMediaCore_FFmpeg.pas @@ -250,7 +250,8 @@ function TMediaCore_FFmpeg.FindStreamIDs(FormatCtx: PAVFormatContext; out FirstV {$IF LIBAVFORMAT_VERSION < 59000000} if (Stream.codec.codec_type = AVMEDIA_TYPE_VIDEO) and - (FirstVideoStream < 0) then + (FirstVideoStream < 0) and + ((Stream.disposition and AV_DISPOSITION_ATTACHED_PIC) <> AV_DISPOSITION_ATTACHED_PIC) then begin FirstVideoStream := i; end; @@ -263,7 +264,8 @@ function TMediaCore_FFmpeg.FindStreamIDs(FormatCtx: PAVFormatContext; out FirstV end; {$ELSE} if (Stream.codecpar.codec_type = AVMEDIA_TYPE_VIDEO) and - (FirstVideoStream < 0) then + (FirstVideoStream < 0) and + ((Stream.disposition and AV_DISPOSITION_ATTACHED_PIC) <> AV_DISPOSITION_ATTACHED_PIC) then begin FirstVideoStream := i; end;