@@ -3837,37 +3837,34 @@ void formatContextFinalizer(napi_env env, void* data, void* hint) {
3837
3837
if (fmtRef->fmtCtx != nullptr ) {
3838
3838
fc = fmtRef->fmtCtx ;
3839
3839
if (fc->pb != nullptr ) {
3840
- if (adaptor)
3841
- avio_context_free (&fc-> pb );
3842
- else {
3840
+ if (adaptor) {
3841
+ avformat_free_context (fc );
3842
+ } else {
3843
3843
ret = avio_closep (&fc->pb );
3844
3844
if (ret < 0 ) {
3845
3845
printf (" DEBUG: For url '%s', %s" , (fc->url != nullptr ) ? fc->url : " unknown" ,
3846
3846
avErrorMsg (" error closing IO: " , ret));
3847
3847
}
3848
- }
3849
- }
3850
3848
3851
- if (fc->iformat != nullptr ) {
3852
- avformat_close_input (&fc);
3853
- } else {
3854
- // FIXME this is segfaulting ... why
3855
- /* if (fc->codec_whitelist != nullptr) {
3856
- av_freep(fc->codec_whitelist);
3857
- }
3858
- if (fc->format_whitelist != nullptr) {
3859
- av_freep(fc->format_whitelist);
3860
- }
3861
- if (fc->protocol_whitelist != nullptr) {
3862
- av_freep(fc->protocol_whitelist);
3849
+ if (fc->iformat != nullptr ) {
3850
+ avformat_close_input (&fc);
3851
+ } else {
3852
+ // FIXME this is segfaulting ... why
3853
+ /* if (fc->codec_whitelist != nullptr) {
3854
+ av_freep(fc->codec_whitelist);
3855
+ }
3856
+ if (fc->format_whitelist != nullptr) {
3857
+ av_freep(fc->format_whitelist);
3858
+ }
3859
+ if (fc->protocol_whitelist != nullptr) {
3860
+ av_freep(fc->protocol_whitelist);
3861
+ }
3862
+ if (fc->protocol_blacklist != nullptr) {
3863
+ av_freep(fc->protocol_blacklist);
3864
+ } */
3865
+ }
3863
3866
}
3864
- if (fc->protocol_blacklist != nullptr) {
3865
- av_freep(fc->protocol_blacklist);
3866
- } */
3867
3867
}
3868
-
3869
- if (adaptor != nullptr ) // crashes otherwise...
3870
- avformat_free_context (fc);
3871
3868
}
3872
3869
3873
3870
delete fmtRef;
0 commit comments