Skip to content

Commit

Permalink
reset_buffer_size need lock
Browse files Browse the repository at this point in the history
  • Loading branch information
debugly committed Nov 5, 2024
1 parent f90ae5d commit 01c3814
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ijkmedia/ijkplayer/ff_ffplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -3330,6 +3330,7 @@ static void reset_buffer_size(FFPlayer *ffp)
if (!ffp->is) {
return;
}
SDL_LockMutex(ffp->is->play_mutex);
int buffer_size = DEFAULT_QUEUE_SIZE;
double audio_delay = ffp->is->audio_st ? get_clock_extral_delay(&ffp->is->audclk) : 0;
AVFormatContext *ic = ffp->is->ic;
Expand All @@ -3349,6 +3350,7 @@ static void reset_buffer_size(FFPlayer *ffp)
}

ffp->dcc.max_buffer_size = buffer_size + fabs(audio_delay) * DEFAULT_QUEUE_SIZE;
SDL_UnlockMutex(ffp->is->play_mutex);
av_log(NULL, AV_LOG_INFO, "auto decision max buffer size:%dMB\n",ffp->dcc.max_buffer_size/1024/1024);
}

Expand Down

0 comments on commit 01c3814

Please sign in to comment.