@scrypted/libav 1.0.23 → 1.0.24

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/decode.cpp +17 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrypted/libav",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "dependencies": {
5
5
  "node-addon-api": "^8.1.0",
6
6
  "prebuild-install": "npm:@scrypted/prebuild-install@^7.1.8"
package/src/decode.cpp CHANGED
@@ -50,19 +50,19 @@ 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];
53
+ // void printAVError(int errnum)
54
+ // {
55
+ // char errbuf[256];
56
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
- }
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
63
 
64
- printf("Error: %s\n", errbuf);
65
- }
64
+ // printf("Error: %s\n", errbuf);
65
+ // }
66
66
 
67
67
  class ReadFrameWorker : public Napi::AsyncWorker
68
68
  {
@@ -94,14 +94,14 @@ public:
94
94
  }
95
95
  else if (ret < 0 || ret == AVERROR_EOF)
96
96
  {
97
- printAVError(ret);
97
+ // printAVError(ret);
98
98
  av_packet_free(&packet);
99
99
  SetError("Could not read frame");
100
100
  return;
101
101
  }
102
102
  else
103
103
  {
104
- printf("returning frame 0\n");
104
+ // printf("returning frame 0\n");
105
105
  av_packet_free(&packet);
106
106
  result = frame;
107
107
  return;
@@ -112,7 +112,7 @@ public:
112
112
  {
113
113
  if (packet->stream_index == videoStreamIndex)
114
114
  {
115
- printf("av packet size: %d\n", packet->size);
115
+ // printf("av packet size: %d\n", packet->size);
116
116
  if ((ret = avcodec_send_packet(codecContext, packet)) == 0)
117
117
  {
118
118
  ret = avcodec_receive_frame(codecContext, frame);
@@ -122,14 +122,14 @@ public:
122
122
  }
123
123
  else if (ret < 0 || ret == AVERROR_EOF)
124
124
  {
125
- printAVError(ret);
125
+ // printAVError(ret);
126
126
  av_packet_free(&packet);
127
127
  SetError("Could not read frame");
128
128
  return;
129
129
  }
130
130
  else
131
131
  {
132
- printf("returning frame 0\n");
132
+ // printf("returning frame 1\n");
133
133
  av_packet_free(&packet);
134
134
  result = frame;
135
135
  return;
@@ -137,7 +137,7 @@ public:
137
137
  }
138
138
  else
139
139
  {
140
- printAVError(ret);
140
+ // printAVError(ret);
141
141
  }
142
142
  }
143
143
  av_packet_unref(packet); // Reset the packet for the next frame