@scrypted/libav 1.0.145 → 1.0.147
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/formatcontext.cpp +5 -2
- package/src/formatcontext.h +2 -0
- package/src/frame.cpp +1 -0
package/package.json
CHANGED
package/src/formatcontext.cpp
CHANGED
|
@@ -307,7 +307,7 @@ Napi::Object AVFormatContextObject::Init(Napi::Env env, Napi::Object exports)
|
|
|
307
307
|
|
|
308
308
|
AVFormatContextObject::AVFormatContextObject(const Napi::CallbackInfo &info)
|
|
309
309
|
: Napi::ObjectWrap<AVFormatContextObject>(info),
|
|
310
|
-
fmt_ctx_(nullptr)
|
|
310
|
+
fmt_ctx_(nullptr), is_input(false)
|
|
311
311
|
{
|
|
312
312
|
// i don't think this constructor is called from js??
|
|
313
313
|
}
|
|
@@ -376,6 +376,7 @@ Napi::Value AVFormatContextObject::Open(const Napi::CallbackInfo &info)
|
|
|
376
376
|
return env.Undefined();
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
+
is_input = true;
|
|
379
380
|
return env.Undefined();
|
|
380
381
|
}
|
|
381
382
|
|
|
@@ -521,7 +522,9 @@ Napi::Value AVFormatContextObject::Close(const Napi::CallbackInfo &info)
|
|
|
521
522
|
{
|
|
522
523
|
if (fmt_ctx_)
|
|
523
524
|
{
|
|
524
|
-
|
|
525
|
+
if (is_input) {
|
|
526
|
+
avformat_close_input(&fmt_ctx_);
|
|
527
|
+
}
|
|
525
528
|
avformat_free_context(fmt_ctx_);
|
|
526
529
|
fmt_ctx_ = nullptr;
|
|
527
530
|
}
|
package/src/formatcontext.h
CHANGED
package/src/frame.cpp
CHANGED
|
@@ -230,6 +230,7 @@ Napi::Value AVFrameObject::CreateEncoder(const Napi::CallbackInfo &info)
|
|
|
230
230
|
c->pix_fmt = (enum AVPixelFormat)frame_->format;
|
|
231
231
|
c->time_base.num = timeBaseNum;
|
|
232
232
|
c->time_base.den = timeBaseDen;
|
|
233
|
+
c->max_b_frames = 0;
|
|
233
234
|
|
|
234
235
|
Napi::Value gopSizeValue = options.Get("gopSize");
|
|
235
236
|
if (gopSizeValue.IsNumber()) {
|