#include "decoder.h" #include #include #include #include #include #include #include // Host-only integration test: run against the same FFmpeg release as the app. // Compares seeks with sequential decoding, including decoder/resampler draining. int main(int argc,char** argv) { if (argc<2) return 2; try { for (int i=1;i all, chunk(2048*2); int count; while ((count=d.read(chunk.data(),2048))>0) all.insert(all.end(),chunk.begin(),chunk.begin()+count*2); if (all.size()(rate*4)) throw std::runtime_error("Fixture must contain at least 2 seconds"); if (d.read(chunk.data(),2048)!=0) throw std::runtime_error("EOF was not stable"); for (int64_t target : {int64_t(0),int64_t(rate/3),int64_t(rate),int64_t(rate+137),int64_t(rate)*3+137}) { d.seek(target); count=d.read(chunk.data(),1024); if (count!=1024) throw std::runtime_error("Short seek output"); double maximum=0; for (int j=0;j0.003) throw std::runtime_error(std::string(argv[i])+": seek mismatch "+std::to_string(maximum)+" at "+std::to_string(target)+" rate "+std::to_string(rate)); } std::cout<