| 223 | } |
| 224 | |
| 225 | void AVPacketWrapper::setDTS(int64_t dts) |
| 226 | { |
| 227 | if (this->libVer.avcodec.major == 56) |
| 228 | { |
| 229 | auto p = reinterpret_cast<AVPacket_56 *>(this->pkt); |
| 230 | p->dts = dts; |
| 231 | this->dts = dts; |
| 232 | } |
| 233 | else if (this->libVer.avcodec.major == 57 || this->libVer.avcodec.major == 58) |
| 234 | { |
| 235 | auto p = reinterpret_cast<AVPacket_57_58 *>(this->pkt); |
| 236 | p->dts = dts; |
| 237 | this->dts = dts; |
| 238 | } |
| 239 | else if (this->libVer.avcodec.major == 59 || // |
| 240 | this->libVer.avcodec.major == 60) |
| 241 | { |
| 242 | auto p = reinterpret_cast<AVPacket_59_60 *>(this->pkt); |
| 243 | p->dts = dts; |
| 244 | this->dts = dts; |
| 245 | } |
| 246 | else |
| 247 | throw std::runtime_error("Invalid library version"); |
| 248 | } |
| 249 | |
| 250 | AVPacket *AVPacketWrapper::getPacket() |
| 251 | { |