@@ -87,15 +87,20 @@ TEST(Demuxing, OpenTestFileAndCheckFormat_ShouldHaveCorrectFormat)
8787 EXPECT_EQ (audioCodecDescriptor->mimeTypes .size (), 0 );
8888
8989 const auto audioCodecParameters = audioStream.getCodecParameters ();
90- EXPECT_EQ (audioCodecParameters->getCodecType (), MediaType::Audio);
91- EXPECT_EQ (audioCodecParameters->getExtradata ().size (), 5 );
92- EXPECT_EQ (audioCodecParameters->getSize (), Size ({0 , 0 }));
93- EXPECT_EQ (audioCodecParameters->getColorspace (), ColorSpace::UNSPECIFIED);
94- EXPECT_THAT (audioCodecParameters->getPixelFormat ().name , testing::AnyOf (" None" , " gray" ));
95- EXPECT_EQ (audioCodecParameters->getSampleAspectRatio (), Rational ({0 , 1 }));
96- EXPECT_THAT (audioCodecParameters->getChannelLayout (),
97- ElementsAre (avcodec::ChannelInfo ({avcodec::Channel::FrontLeft, {}, " FL" }),
98- avcodec::ChannelInfo ({avcodec::Channel::FrontRight, {}, " FR" })));
90+ if (majorVersion <= 56 )
91+ EXPECT_FALSE (audioCodecParameters);
92+ else
93+ {
94+ EXPECT_EQ (audioCodecParameters->getCodecType (), MediaType::Audio);
95+ EXPECT_EQ (audioCodecParameters->getExtradata ().size (), 5 );
96+ EXPECT_EQ (audioCodecParameters->getSize (), Size ({0 , 0 }));
97+ EXPECT_EQ (audioCodecParameters->getColorspace (), ColorSpace::UNSPECIFIED);
98+ EXPECT_THAT (audioCodecParameters->getPixelFormat ().name , testing::AnyOf (" None" , " gray" ));
99+ EXPECT_EQ (audioCodecParameters->getSampleAspectRatio (), Rational ({0 , 1 }));
100+ EXPECT_THAT (audioCodecParameters->getChannelLayout (),
101+ ElementsAre (avcodec::ChannelInfo ({avcodec::Channel::FrontLeft, {}, " FL" }),
102+ avcodec::ChannelInfo ({avcodec::Channel::FrontRight, {}, " FR" })));
103+ }
99104
100105 if (majorVersion == 56 )
101106 // FFmpeg versions 2 does not parse profiles in the descriptor
0 commit comments