Skip to content

Commit

Permalink
Parse pixel format for new interface correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFeldmann committed Sep 4, 2023
1 parent fa0eef7 commit bd3e8a0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions YUViewLib/src/ffmpeg/AVPixFmtDescriptorWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ typedef struct AVComponentDescriptor_57
int depth;
} AVComponentDescriptor_57;

typedef struct AVPixFmtDescriptor_57
typedef struct AVPixFmtDescriptor_57_58
{
const char * name;
uint8_t nb_components;
Expand All @@ -118,7 +118,7 @@ typedef struct AVPixFmtDescriptor_57
uint64_t flags;
AVComponentDescriptor_57 comp[4];
const char * alias;
} AVPixFmtDescriptor_57;
} AVPixFmtDescriptor_57_58;

AVPixFmtDescriptorWrapper::Flags parseFlags(uint8_t flagsValue)
{
Expand Down Expand Up @@ -217,9 +217,10 @@ AVPixFmtDescriptorWrapper::AVPixFmtDescriptorWrapper(AVPixFmtDescriptor *descrip

aliases = QString(p->alias);
}
else if (libVer.avutil.major == 57)
else if (libVer.avutil.major == 57 || //
libVer.avutil.major == 58)
{
auto p = reinterpret_cast<AVPixFmtDescriptor_57 *>(descriptor);
auto p = reinterpret_cast<AVPixFmtDescriptor_57_58 *>(descriptor);
this->name = QString(p->name);
this->nb_components = p->nb_components;
this->log2_chroma_w = p->log2_chroma_w;
Expand Down

0 comments on commit bd3e8a0

Please sign in to comment.