Skip to content

Commit

Permalink
fix stream sound position
Browse files Browse the repository at this point in the history
  • Loading branch information
lieff committed Oct 7, 2017
1 parent b0610e4 commit 367e90b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions swf/avm1.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,13 @@ void handle_frame_change(LVGActionCtx *ctx, LVGMovieClipGroupState *groupstate)
if (groupstate->cur_frame > ssound->start_frame && groupstate->cur_frame <= ssound->end_frame)
{
LVGSound *sound = ctx->clip->sounds + ssound->sound_id;
double time = (double)(ssound->start_frame - groupstate->cur_frame)/ctx->clip->fps;
double time = (double)(groupstate->cur_frame - ssound->start_frame)/ctx->clip->fps;
int start_sample = sound->rate*time;
if (start_sample >= sound->num_samples)
return;
lvgPlaySound(sound, PLAY_SyncStop, 0, 0, 0);
if (LVG_STOPPED == groupstate->play_state)
return
return;
lvgPlaySound(sound, 0, start_sample, sound->num_samples, 0);
return;
}
Expand Down

0 comments on commit 367e90b

Please sign in to comment.