| 198 | } |
| 199 | |
| 200 | void AVPacketWrapper::setPTS(int64_t pts) |
| 201 | { |
| 202 | if (this->libVer.avcodec.major == 56) |
| 203 | { |
| 204 | auto p = reinterpret_cast<AVPacket_56 *>(this->pkt); |
| 205 | p->pts = pts; |
| 206 | this->pts = pts; |
| 207 | } |
| 208 | else if (this->libVer.avcodec.major == 57 || this->libVer.avcodec.major == 58) |
| 209 | { |
| 210 | auto p = reinterpret_cast<AVPacket_57_58 *>(this->pkt); |
| 211 | p->pts = pts; |
| 212 | this->pts = pts; |
| 213 | } |
| 214 | else if (this->libVer.avcodec.major == 59 || // |
| 215 | this->libVer.avcodec.major == 60) |
| 216 | { |
| 217 | auto p = reinterpret_cast<AVPacket_59_60 *>(this->pkt); |
| 218 | p->pts = pts; |
| 219 | this->pts = pts; |
| 220 | } |
| 221 | else |
| 222 | throw std::runtime_error("Invalid library version"); |
| 223 | } |
| 224 | |
| 225 | void AVPacketWrapper::setDTS(int64_t dts) |
| 226 | { |