Instead of just blindly multiplying by 2 it would make the code clearer to do this:

     int num_channels = 2;
     __AdjustBGMVolume((s16 *)out, frame->nb_samples * num_channels);

and later below
     bytespcm += ret * sizeof(s16) * num_channels;