@scrypted/libav 1.0.11 → 1.0.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrypted/libav",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
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
@@ -141,7 +141,6 @@ public:
141
141
  private:
142
142
  static Napi::FunctionReference constructor;
143
143
  AVFormatContext *fmt_ctx_;
144
- bool owns_context_; // Flag to indicate if we should free the context
145
144
  int videoStreamIndex;
146
145
  AVCodecContext *codecContext;
147
146
  AVBufferRef *hw_device_ctx;
@@ -200,7 +199,6 @@ Napi::Object AVFormatContextObject::Init(Napi::Env env, Napi::Object exports)
200
199
 
201
200
  AVFormatContextObject::AVFormatContextObject(const Napi::CallbackInfo &info)
202
201
  : Napi::ObjectWrap<AVFormatContextObject>(info),
203
- owns_context_(true),
204
202
  videoStreamIndex(-1),
205
203
  codecContext(nullptr),
206
204
  hw_device_ctx(nullptr)
@@ -221,7 +219,6 @@ AVFormatContextObject::AVFormatContextObject(const Napi::CallbackInfo &info)
221
219
  }
222
220
 
223
221
  fmt_ctx_ = reinterpret_cast<AVFormatContext *>(value);
224
- owns_context_ = false; // We don't own this context, so we shouldn't free it
225
222
  }
226
223
  else
227
224
  {
@@ -232,7 +229,6 @@ AVFormatContextObject::AVFormatContextObject(const Napi::CallbackInfo &info)
232
229
  Napi::Error::New(env, "Failed to allocate AVFormatContext").ThrowAsJavaScriptException();
233
230
  return;
234
231
  }
235
- owns_context_ = true; // We own this context, so we should free it when done
236
232
  }
237
233
  }
238
234
 
@@ -514,18 +510,11 @@ Napi::Value AVFormatContextObject::Open(const Napi::CallbackInfo &info)
514
510
 
515
511
  AVFormatContextObject::~AVFormatContextObject()
516
512
  {
517
- if (owns_context_ && fmt_ctx_)
518
- {
519
- av_log(NULL, AV_LOG_INFO, "Destroyng AVFormatContext\n");
520
- avformat_close_input(&fmt_ctx_);
521
- avformat_free_context(fmt_ctx_);
522
- fmt_ctx_ = nullptr;
523
- }
524
513
  }
525
514
 
526
515
  Napi::Value AVFormatContextObject::Close(const Napi::CallbackInfo &info)
527
516
  {
528
- if (owns_context_ && fmt_ctx_)
517
+ if (fmt_ctx_)
529
518
  {
530
519
  av_log(NULL, AV_LOG_INFO, "Closing AVFormatContext\n");
531
520
  avformat_close_input(&fmt_ctx_);
package/src/filter.cpp CHANGED
@@ -63,11 +63,6 @@ AVFilterGraphObject::AVFilterGraphObject(const Napi::CallbackInfo &info)
63
63
 
64
64
  AVFilterGraphObject::~AVFilterGraphObject()
65
65
  {
66
- if (filterGraph)
67
- {
68
- avfilter_graph_free(&filterGraph);
69
- filterGraph = nullptr;
70
- }
71
66
  }
72
67
 
73
68
  Napi::Value AVFilterGraphObject::Destroy(const Napi::CallbackInfo &info)
package/src/frame.cpp CHANGED
@@ -82,11 +82,6 @@ AVFrameObject::AVFrameObject(const Napi::CallbackInfo &info)
82
82
 
83
83
  AVFrameObject::~AVFrameObject()
84
84
  {
85
- if (frame_)
86
- {
87
- av_frame_free(&frame_);
88
- frame_ = nullptr;
89
- }
90
85
  }
91
86
 
92
87
  Napi::Value AVFrameObject::ToJPEG(const Napi::CallbackInfo &info)