@scrypted/libav 1.0.144 → 1.0.145
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/codeccontext.cpp +10 -8
- package/src/formatcontext.cpp +1 -1
package/package.json
CHANGED
package/src/codeccontext.cpp
CHANGED
|
@@ -105,11 +105,12 @@ public:
|
|
|
105
105
|
ReceiveFrameWorker(napi_env env, napi_deferred deferred, AVCodecContext *codecContext)
|
|
106
106
|
: Napi::AsyncWorker(env), deferred(deferred), codecContext(codecContext)
|
|
107
107
|
{
|
|
108
|
-
result = nullptr;
|
|
109
108
|
}
|
|
110
109
|
|
|
111
110
|
void Execute() override
|
|
112
111
|
{
|
|
112
|
+
result = nullptr;
|
|
113
|
+
|
|
113
114
|
AVFrame *frame = av_frame_alloc();
|
|
114
115
|
if (!frame)
|
|
115
116
|
{
|
|
@@ -167,11 +168,12 @@ public:
|
|
|
167
168
|
ReceivePacketWorker(napi_env env, napi_deferred deferred, AVCodecContext *codecContext)
|
|
168
169
|
: Napi::AsyncWorker(env), deferred(deferred), codecContext(codecContext)
|
|
169
170
|
{
|
|
170
|
-
result = nullptr;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
void Execute() override
|
|
174
174
|
{
|
|
175
|
+
result = nullptr;
|
|
176
|
+
|
|
175
177
|
AVPacket *packet = av_packet_alloc();
|
|
176
178
|
if (!packet)
|
|
177
179
|
{
|
|
@@ -265,9 +267,11 @@ public:
|
|
|
265
267
|
|
|
266
268
|
void Execute() override
|
|
267
269
|
{
|
|
270
|
+
result = false;
|
|
271
|
+
|
|
268
272
|
if (!frame)
|
|
269
273
|
{
|
|
270
|
-
SetError("
|
|
274
|
+
SetError("SendFrame received null frame");
|
|
271
275
|
return;
|
|
272
276
|
}
|
|
273
277
|
if (!codecContext)
|
|
@@ -284,8 +288,6 @@ public:
|
|
|
284
288
|
return;
|
|
285
289
|
}
|
|
286
290
|
|
|
287
|
-
result = false;
|
|
288
|
-
|
|
289
291
|
if (ret != AVERROR(EAGAIN))
|
|
290
292
|
{
|
|
291
293
|
// what would cause this?
|
|
@@ -326,9 +328,11 @@ public:
|
|
|
326
328
|
|
|
327
329
|
void Execute() override
|
|
328
330
|
{
|
|
331
|
+
result = false;
|
|
332
|
+
|
|
329
333
|
if (!packet)
|
|
330
334
|
{
|
|
331
|
-
SetError("
|
|
335
|
+
SetError("SendPacket received null packet");
|
|
332
336
|
return;
|
|
333
337
|
}
|
|
334
338
|
|
|
@@ -340,8 +344,6 @@ public:
|
|
|
340
344
|
return;
|
|
341
345
|
}
|
|
342
346
|
|
|
343
|
-
result = false;
|
|
344
|
-
|
|
345
347
|
if (ret != AVERROR(EAGAIN))
|
|
346
348
|
{
|
|
347
349
|
// errors are typically caused by missing codec info
|
package/src/formatcontext.cpp
CHANGED
|
@@ -671,7 +671,7 @@ Napi::Value AVFormatContextObject::WriteFrame(const Napi::CallbackInfo &info)
|
|
|
671
671
|
|
|
672
672
|
if (!packet)
|
|
673
673
|
{
|
|
674
|
-
Napi::Error::New(env, "
|
|
674
|
+
Napi::Error::New(env, "WriteFrame received null frame").ThrowAsJavaScriptException();
|
|
675
675
|
return env.Undefined();
|
|
676
676
|
}
|
|
677
677
|
|