@scrypted/libav 1.0.147 → 1.0.149
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/lib/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/formatcontext.cpp +6 -3
- package/src/index.ts +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -92,7 +92,7 @@ export interface AVFormatContext {
|
|
|
92
92
|
open(input: string): void;
|
|
93
93
|
createDecoder(streamIndex: number, hardwareDevice?: string, decoder?: string, deviceName?: string): AVCodecContext;
|
|
94
94
|
readFrame(): Promise<AVPacket>;
|
|
95
|
-
receiveFrame(streamIndex: number, codecContext: AVCodecContext): Promise<AVFrame>;
|
|
95
|
+
receiveFrame(streamIndex: number, codecContext: AVCodecContext): Promise<AVFrame | AVPacket>;
|
|
96
96
|
create(format: string, callback: (buffer: Buffer) => void): void;
|
|
97
97
|
newStream(options: {
|
|
98
98
|
codecContext?: AVCodecContext;
|
package/package.json
CHANGED
package/src/formatcontext.cpp
CHANGED
|
@@ -196,9 +196,9 @@ public:
|
|
|
196
196
|
|
|
197
197
|
if (packet->stream_index != streamIndex)
|
|
198
198
|
{
|
|
199
|
-
// wrong stream,
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
// wrong stream, return the packet
|
|
200
|
+
packetResult = packet;
|
|
201
|
+
return;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
ret = avcodec_send_packet(codecContext, packet);
|
|
@@ -525,6 +525,9 @@ Napi::Value AVFormatContextObject::Close(const Napi::CallbackInfo &info)
|
|
|
525
525
|
if (is_input) {
|
|
526
526
|
avformat_close_input(&fmt_ctx_);
|
|
527
527
|
}
|
|
528
|
+
if (callbackRef) {
|
|
529
|
+
callbackRef.Release();
|
|
530
|
+
}
|
|
528
531
|
avformat_free_context(fmt_ctx_);
|
|
529
532
|
fmt_ctx_ = nullptr;
|
|
530
533
|
}
|
package/src/index.ts
CHANGED
|
@@ -197,7 +197,7 @@ export interface AVFormatContext {
|
|
|
197
197
|
open(input: string): void;
|
|
198
198
|
createDecoder(streamIndex: number, hardwareDevice?: string, decoder?: string, deviceName?: string): AVCodecContext;
|
|
199
199
|
readFrame(): Promise<AVPacket>;
|
|
200
|
-
receiveFrame(streamIndex: number, codecContext: AVCodecContext): Promise<AVFrame>;
|
|
200
|
+
receiveFrame(streamIndex: number, codecContext: AVCodecContext): Promise<AVFrame|AVPacket>;
|
|
201
201
|
create(format: string, callback: (buffer: Buffer) => void): void;
|
|
202
202
|
newStream(options: {
|
|
203
203
|
codecContext?: AVCodecContext,
|