Skip to content

Commit

Permalink
try disambuigating Value()
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev committed Jan 2, 2024
1 parent 7a8e199 commit 77c89a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/binding/avcpp-readable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ int ReadableCustomIO::seekable() const { return 0; }
void ReadableCustomIO::PushPendingData(int64_t to_read) {
verbose("ReadableCustomIO: push pending data: request %lu bytes\n", to_read);
Napi::Env env(Env());
Napi::Function push = Value().Get("push").As<Napi::Function>();
Napi::Function push = this->Value().Get("push").As<Napi::Function>();
assert(!queue.empty());
do {
auto buf = queue.front();
queue.pop();
if (buf->data == nullptr) {
// This is EOF
verbose("ReadableCustomIO: pushing null to signal EOF\n");
push.MakeCallback(Value(), {env.Null()});
push.MakeCallback(this->Value(), {env.Null()});
delete buf;
eof = true;
return;
Expand All @@ -94,7 +94,7 @@ void ReadableCustomIO::PushPendingData(int64_t to_read) {
Napi::Buffer<uint8_t>::New(env, buf->data, buf->length, [](Napi::Env, uint8_t *buffer) { delete[] buffer; });
#endif
verbose("ReadableCustomIO: pushed Buffer length %lu, request remaining %ld\n", buf->length, to_read);
push.MakeCallback(Value(), 1, &js_buffer);
push.MakeCallback(this->Value(), 1, &js_buffer);
queue_size -= buf->length;
delete buf;
} while (!queue.empty() && to_read > 0);
Expand Down

0 comments on commit 77c89a6

Please sign in to comment.