@scrypted/libav 1.0.20 → 1.0.21
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/decode.cpp +16 -2
package/package.json
CHANGED
package/src/decode.cpp
CHANGED
|
@@ -50,6 +50,20 @@ Napi::Value set_console_callback(const Napi::CallbackInfo &info)
|
|
|
50
50
|
return env.Null();
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
void printAVError(int errnum)
|
|
54
|
+
{
|
|
55
|
+
char errbuf[256];
|
|
56
|
+
|
|
57
|
+
// Convert the error code to a string
|
|
58
|
+
if (av_strerror(errnum, errbuf, sizeof(errbuf)) < 0)
|
|
59
|
+
{
|
|
60
|
+
printf("Unknown error code: %d", errnum);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
printf("Error: %s\n", errbuf);
|
|
65
|
+
}
|
|
66
|
+
|
|
53
67
|
class ReadFrameWorker : public Napi::AsyncWorker
|
|
54
68
|
{
|
|
55
69
|
public:
|
|
@@ -96,12 +110,12 @@ public:
|
|
|
96
110
|
}
|
|
97
111
|
else
|
|
98
112
|
{
|
|
99
|
-
|
|
113
|
+
printAVError(ret);
|
|
100
114
|
}
|
|
101
115
|
}
|
|
102
116
|
else
|
|
103
117
|
{
|
|
104
|
-
|
|
118
|
+
printAVError(ret);
|
|
105
119
|
}
|
|
106
120
|
}
|
|
107
121
|
av_packet_unref(packet); // Reset the packet for the next frame
|