2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Patch the remaining uses or FFmpeg APIs

This commit is contained in:
Alexander Kernozhitsky
2022-09-02 01:27:25 +03:00
committed by John Preston
parent 21b0454461
commit c6c2a44e9d
5 changed files with 23 additions and 18 deletions

View File

@@ -47,11 +47,11 @@ private:
return (_rotation == 90) || (_rotation == 270);
}
[[nodiscard]] static int Read(
[[nodiscard]] static int _read(
void *opaque,
uint8_t *buf,
int buf_size);
[[nodiscard]] static int64_t Seek(
[[nodiscard]] static int64_t _seek(
void *opaque,
int64_t offset,
int whence);
@@ -113,7 +113,7 @@ int FrameGenerator::Impl::Read(void *opaque, uint8_t *buf, int buf_size) {
int FrameGenerator::Impl::read(uint8_t *buf, int buf_size) {
const auto available = _bytes.size() - _deviceOffset;
if (available <= 0) {
return -1;
return AVERROR_EOF;
}
const auto fill = std::min(int(available), buf_size);
memcpy(buf, _bytes.data() + _deviceOffset, fill);