Skip to content

Commit d79139d

Browse files
committed
Ensure decoder is created from codec_id if available
1 parent 375e05e commit d79139d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/decode.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ napi_value decoder(napi_env env, napi_callback_info info) {
8181
NAPI_THROW_ERROR("Stream index is out of bounds for the given format.");
8282
}
8383
params = format->streams[streamIdx]->codecpar;
84+
codecID = params->codec_id;
8485
codecName = (char*) avcodec_get_name(params->codec_id);
8586
codecNameLen = strlen(codecName);
8687
goto create;
@@ -98,6 +99,7 @@ napi_value decoder(napi_env env, napi_callback_info info) {
9899
}
99100
status = napi_get_value_external(env, jsParams, (void**) &params);
100101
CHECK_STATUS;
102+
codecID = params->codec_id;
101103
codecName = (char*) avcodec_get_name(params->codec_id);
102104
codecNameLen = strlen(codecName);
103105
goto create;

0 commit comments

Comments
 (0)