Skip to content

Commit

Permalink
dav1d: use more than 1 thread (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asd-g committed Mar 10, 2024
1 parent 8927ea9 commit c426c9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions common/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ int open_decoder
* For instance, when stream is encoded as AC-3,
* AVCodecContext.codec_id might have been set to AV_CODEC_ID_EAC3
* while AVCodec.id is set to AV_CODEC_ID_AC3. */
if( !strcmp( codec->name, "libdav1d" )
&& (ret = av_opt_set_int( c->priv_data, "framethreads", 1, 0 )) < 0 )
if (!strcmp(codec->name, "libdav1d")
&& (ret = av_opt_set_int(c->priv_data, "max_frame_delay", 2, 0)) < 0)
goto fail;
else if( !strcmp( codec->name, "vp9" )
&& thread_count != 1
Expand Down
5 changes: 4 additions & 1 deletion common/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ static inline uint32_t get_decoder_delay
AVCodecContext *ctx
)
{
return ctx->has_b_frames + ((ctx->active_thread_type & FF_THREAD_FRAME) ? ctx->thread_count - 1 : 0);
if (!strcmp(ctx->codec->name, "libdav1d"))
return ctx->delay;
else
return ctx->has_b_frames + ((ctx->active_thread_type & FF_THREAD_FRAME) ? ctx->thread_count - 1 : 0);
}

const AVCodec *find_decoder
Expand Down

0 comments on commit c426c9f

Please sign in to comment.